+ 1

Write a python program that asks the user for an hour between 1 and 12 and for how many hours in the future they want to go.

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:- Enter hour: 8 How many hours ahead? 5 New hour: 1 o'clock

25th Aug 2018, 2:25 PM
Divyansh Sunny
Divyansh Sunny - avatar
10 Respostas
+ 3
Homework?
25th Aug 2018, 2:33 PM
Hatsy Rei
Hatsy Rei - avatar
+ 2
s=int(input("Enter hour:")) t=int(input ("How many hours ahead?")) n=I'm not getting it. print("New hour:",n)
26th Aug 2018, 4:08 AM
Divyansh Sunny
Divyansh Sunny - avatar
+ 1
What have you tried doing? At least show us that you've made some effort.
25th Aug 2018, 8:07 PM
Russ
Russ - avatar
27th Aug 2018, 7:24 AM
Russ
Russ - avatar
+ 1
Don't know how to run the code? Click on the code I posted above, then click on 'Run'. When it asks you for input, give your two numbers on separate lines. To create your own code, hit the code tab, then the '+' symbol and your chosen language.
27th Aug 2018, 8:12 AM
Russ
Russ - avatar
0
no
25th Aug 2018, 2:38 PM
Divyansh Sunny
Divyansh Sunny - avatar
0
I'm just not getting answer.
25th Aug 2018, 2:39 PM
Divyansh Sunny
Divyansh Sunny - avatar
0
n=s+t-12 if n<=0: print("new hour",s+t) else: print ("new hour",n)
26th Aug 2018, 4:44 AM
Divyansh Sunny
Divyansh Sunny - avatar
0
I'm new to this app so I don't know how to run it.can you please tell me.i have just started 2 days ago.
27th Aug 2018, 7:50 AM
Divyansh Sunny
Divyansh Sunny - avatar
0
thanks
27th Aug 2018, 8:14 AM
Divyansh Sunny
Divyansh Sunny - avatar