python Write a program that uses a text file to store the days and hours that a user worked in a week. The program should begin by prompting for the number of days worked in the week. It should continue with a loop for input of the days and hours and for writing these to the file, each on its own line. Sample Output (inputs shown in boldface) How many days did you work this week? 5 Enter day of week Monday How many hours did you work on Monday? 10 Enter day of week Tuesday How many hours did you work on Tuesday? 8 Enter day of week Wednesday How many hours did you work on Wednesday? 12 Enter day of week Friday How many hours did you work on Friday? 12 Enter day of week Saturday How many hours did you work on Saturday? 8 File was created
python
Write a program that uses a text file to store the days and hours that a user worked in a week. The program should begin by prompting for the number of days worked in the week. It should continue with a loop for input of the days and hours and for writing these to the file, each on its own line.
Sample Output (inputs shown in boldface)
How many days did you work this week? 5
Enter day of week Monday
How many hours did you work on Monday? 10
Enter day of week Tuesday
How many hours did you work on Tuesday? 8
Enter day of week Wednesday
How many hours did you work on Wednesday? 12
Enter day of week Friday
How many hours did you work on Friday? 12
Enter day of week Saturday
How many hours did you work on Saturday? 8
File was created
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images