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 
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
Get step-by-step solutions from verified subject matter experts
