2. Write a program that takes a keyboard input and writes an output file with the keyboard input as the text within the output file. Example Input/Output Input: pineapples Output: pineapples has been written to ____.txt (____ can be whatever you want to be for the output file name.)
Added by Jennifer C.
Close
Step 1
This will be the text to write to the file. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 74 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 program that reads each line in a file, reverses its lines, and writes them to another file. For example, if the file input.txt contains the lines: Mary had a little lamb. Its fleece was white as snow. And everywhere that Mary went, the lamb was sure to go. then the output.txt contains: The lamb was sure to go. And everywhere that Mary went, its fleece was white as snow. Mary had a little lamb. You may assume that the input file is called inputex3.txt and the output file is outputex3.txt.
Akash M.
Submit FileIO.py Create a Python Program the reads in the file: Input.txt download and outputs to a file, each line of the input file preceded by the line number, and then the total number of lines in the file. name the output file: output.txt. example output: line 1: dogs barkline 2: cats meowline 3: cows moooline 4: ducks quackline 5: people talkline 6: and doves crytotal of: 6 lines read from input file
Liam H.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD