Python Forum
how to think like a computer scientist
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to think like a computer scientist
#3
current_time_str = input("What is the current time? ")
waiting_time_str = input("How many hours do you have to wait? ")

current_time_int = int(current_time_str)
waiting_time_int = int(waiting_time_str)

hours = current_time_int + waiting_time_int

timeofday = hours % 24

print(timeofday)
This works. However, I am unsure on what to do with the "am" and "pm".
Reply


Messages In This Thread
RE: how to think like a computer scientist - by broke_university_student - Jan-05-2018, 06:39 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020