+ 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
10 Respuestas
+ 3
Homework?
+ 2
s=int(input("Enter hour:"))
t=int(input ("How many hours ahead?"))
n=I'm not getting it.
print("New hour:",n)
+ 1
What have you tried doing? At least show us that you've made some effort.
+ 1
Divyansh Sunny Your code works!
https://code.sololearn.com/cwmWQ1QUnR7J/?ref=app
+ 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.
0
no
0
I'm just not getting answer.
0
n=s+t-12
if n<=0:
print("new hour",s+t)
else:
print ("new hour",n)
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.
0
thanks