(Jan-05-2018, 06:39 AM)broke_university_student Wrote: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".
I think I found a solution,
current_datetime = input("What is the current time (in hours)? ") meridien = input('Enter am/pm: ') waiting_time = input("How many hours do you have to wait? ") current_time_int = int(current_datetime) waiting_time_int = int(waiting_time) hours = current_time_int + waiting_time_int timeofday = hours % 24 print(timeofday,meridien)
buran write Dec-03-2020, 08:38 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.