Question: Python USPres Word Document George Washington John Adams Thomas Jefferson James Madison James Monroe John Q. Adams Andrew Jackson Martin Van Buren William Harrison John

Python

Python USPres Word Document George Washington John Adams Thomas Jefferson James Madison

USPres Word Document

George Washington John Adams Thomas Jefferson James Madison James Monroe John Q. Adams Andrew Jackson Martin Van Buren William Harrison John Tyler James Polk Zachary Taylor Millard Fillmore Franklin Pierce James Buchanan Abraham Lincoln Andrew Johnson Ulysses Grant Rutherford Hayes James Garfield Chester Arthur Grover Cleveland Benjamin Harrison Grover Cleveland William McKinley Theodore Roosevelt William Taft Woodrow Wilson Warren Harding Calvin Coolidge Herbert Hoover Franklin Roosevelt Harry Truman Dwight Eisenhower John Kennedy Lyndon Johnson Richard Nixon Gerald Ford James Carter Ronald Reagan George H. W. Bush Bill Clinton George W. Bush Barack Obama

IS240 Project 2 Set up a program to read a text file that contains the first 44 presidents of the United States - USPres.txt. There are 2 functions needed for the project. def main) Starting function Open the file Whle there are more records on the fle Read the President from the file Add the President to a List After loop display the number of Presidents read from the file Call findPres (list of presidents) def findPres(list of presidents) Prompt the user to enter a range for the presidents - both beginning and ending Display the presidents in the range Output in Shell: Shell Number of lines read 44 Enter the lower number for the range4 Enter the lower number for the range10 Presidents 4 James Madison 5 James Monroe 6 John Q. Adam:s 7 Andrew Jackson 8 Martin Van Buren William Harrison 10 John Tyler

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!