Counting numbers, letters, and other things from a text file

Counting numbers, letters, and other things from a text file
Python Reading Files

Write a function that can take in a text file and return the number of characters in the file categorized by:

  • alphabetic
  • numeric
  • other non space characters

The input to the function will be a text file (you can assume we scane the whole file). To help with this question, here is an example text file that we'll be using in our solution. For an additional hint, see this webpage.

Solution will be written in Python for premium users.






Want the solutions? Upgrade to premium to access detailed solutions to each problem (including this one).

Was this email forwarded to you? You can join our list here to receive questions


Unsubscribe

Older messages

Calculating quarterly moving average of revenue in SQL

Friday, April 2, 2021

Data Interview Qs Calculating quarterly moving average of revenue in SQL SQL Database Querying Window Function Moving Average Suppose you're working with a large conglomerate and are trying to

Best ad group

Wednesday, March 31, 2021

Data Interview Qs Best ad group Data Analysis Python Pandas Data Manipulation External Dataset Given the following dataset, can you identify the top 3 performing ad groups? Explain how you evaluated

Snowblowing a driveway

Monday, March 29, 2021

Data Interview Qs Snowblowing a driveway Calculus Rate of change General logic Suppose it starts snowing at a constant rate. Eventually, at 9am an individual comes out of their house with a snowblower

Classifying customer frequency

Friday, March 26, 2021

Data Interview Qs Classifying customer frequency Data Analysis Python Pandas Data Manipulation Data Visualization Histogram External Dataset Given the following dataset, classify customer value based

Employee salary history

Wednesday, March 24, 2021

Data Interview Qs Employee salary history SQL Database Querying Window Function Lead Function You are given the following table containing historical employee salaries for company XYZ: Table:

You Might Also Like

Kotlin Weekly #407

Sunday, May 19, 2024

ISSUE #407 19th of May 2024 Hello Kotliners! The Google I/O just finished this week with a huge announcement for us, with Google supporting now Kotlin Multiplatform on Android, and the KotlinConf will

Learn How to Use AI to Reach Your Full Potential, newsletterest1!

Sunday, May 19, 2024

3 Ways AI Can Help Your Writing ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌

Software Testing Weekly - Issue 220

Saturday, May 18, 2024

Software Testing Conferences 📚 View on the Web Archives ISSUE 220 May 18th 2024 COMMENT Welcome to the 220th issue! Have you ever been to a testing conference? They're a great way to learn about

📶 Is a Cellular iPad Worth It? — How to Prevent YouTube From Taking Over Your Screensaver

Saturday, May 18, 2024

Also: This Robot Vacuum Can Clean Stairs, and More! How-To Geek Logo May 18, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by

Weekend Reading — Objection-oriented programming

Saturday, May 18, 2024

This week we find a power-up box, replace GitHub Actions with Maven XMLs, avoid the worst website in the world, revisit RTO policies, “listen” to OpenAI employees, watch our Slack private messages, do

Daily Coding Problem: Problem #1445 [Easy]

Saturday, May 18, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Jane Street. The United States uses the imperial system of weights and measures, which

You don’t have to take our word for it…

Saturday, May 18, 2024

You can probably tell how excited we are to re-launch our Gigantic courses – which bring on-demand product management training for today's modern Product Managers and Product Leaders. In fact, we

🐍 New Python tutorials on Real Python

Saturday, May 18, 2024

Hey there, There's always something going on over at realpython.com as far as Python tutorials go. Here's what you may have missed this past week: What Is the __pycache__ Folder in Python? In

Visualized | Life Expectancy by Region (1950-2050F) 📊

Saturday, May 18, 2024

This map shows life expectancy at birth for key global regions, from 1950 to 2050F. View Online | Subscribe Presented by Voronoi: The App Where Data Tells the Story FEATURED STORY Life Expectancy by

New Wi-Fi Vulnerability Enables Network Eavesdropping via Downgrade Attacks

Saturday, May 18, 2024

THN Daily Updates Newsletter cover The DevSecOps Playbook: Deliver Continuous Security at Speed ($19.00 Value) FREE for a Limited Time A must-read guide to a new and rapidly growing field in