Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Please write the following programs in Python 3. Please also show all outputs. (Remove text) Write a program that removes all the occurrences of
1. Please write the following programs in Python 3. Please also show all outputs.
(Remove text) Write a program that removes all the occurrences of a specified string from a text file. Your program should prompt the user to enter a filename and a string to be removed. Here is a sample run: 1. Enter a filename: test.txt Enter Enter the string to be removed: morningta Done (Count characters, words, and lines in a file) Write a program that will count the number of characters, words, and lines in a file. Words are separated by a whitespace character. Your program should prompt the user to enter a filename. Here is a sample run: 2. Enter a filename: test.txt 1777 characters 210 words 71 lines (Write/read data) Write a program that writes 100 integers created randomly into a file. Integers are separated by a space in the file. Read the data back from the file and display the sorted data. Your program should prompt the user to enter a filename. If the file already exists, do not override it. Here is a sample run: 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started