In python, Open and read a file. Using an accumulator, count the number of numbers and total them. Using an accumulator, count the number of letters. Take your count and save it to a different file.
Added by John C.
Step 1
```python file = open('input_file.txt', 'r') content = file.read() file.close() ``` Show more…
Show all steps
Your feedback will help us improve your experience
Madhur L and 58 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
write a python program to read a file and display the number of vowels, consonants, uppercase, lowercase characters in a file
Madhur L.
Write a method/function called bigwords() to read the contents from a text file code.txt and count and display the occurrence of words that have 5 or more alphabets in Python 12th class.
Liam H.
Write and test a Python script that reads in a character string and an integer and outputs the character string repeated the number of times given by the integer.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD