Assignment
University
University of ReginaCourse
Computer Science (UR)Pages
1
Academic year
2023
Avaiya Priyank
Views
0
p {margin: 0; padding: 0;} .ft00{font-size:23px;font-family:Calibri-Light;color:#000000;} .ft01{font-size:23px;font-family:ArialMT;color:#000000;} .ft02{font-size:16px;font-family:Calibri;color:#000000;} .ft03{font-size:23px;line-height:31px;font-family:Calibri-Light;color:#000000;} 9. Write a program that asks the user for an hour between 1 and 12 and for how many hours in the future they want to go. Print out what the hour will be that many hours into the future. An example is shown below. time=int(input("Enter the hours here: ")) extra=int(input("Enter the extra time: ")) if (time+extra)>12: print("New hours: ", (time+extra)-12) else: print("New hours: ", (time+extra))
Calculating Future Hour based on User Input in Python
Please or to post comments