Question: PYTHON Write a program that asks the user for the name of a txt file (we will use suess.txt as the test file) and to

PYTHON PYTHON Write a program that asks the user for the name of

Write a program that asks the user for the name of a txt file (we will use suess.txt as the test file) and to pick either "odd" or "even". Then the program reads this file and prints only odd or even numbered lines of the input file's contents, depending on which the user picks (presume the first line is line 1) For example, if the file contains the lines Do you like green eggs and ham? I like them, Sam I am! Do you like green eggs and ham, Sam? Do you like them, Sam I am? And the user chooses odd, output: Do you like green eggs and ham? Do you like green eggs and ham, Sam

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!