lundi 4 janvier 2021

How to create a program that takes user input USA time and convertes it in BG time with python?

Given the difference in hours between USA and Bulgaria = 7h I have this list with hours. The idea is, for example, the user gives input 12 AM, and the program loops thru the list find what the input 12 AM (USA time) equals and returns the answer 7:00(BG time) and vice versa.

usa_time = ['12AM=7:00','1AM=8:00','2AM=9:00','3AM=10:00','4AM=11:00','5AM=12:00','6AM=13:00','7AM=14:00','8AM=15:00','9AM=16:00','10AM=17:00','11AM=18:00','12PM=19:00','1PM=20:00','2PM=21:00','3PM=22:00','4PM=23:00','5PM=00:00','6PM=1:00','7PM=2:00','8PM=3:00','9PM=4:00','10PM=5:00','11PM=6:00']

user_input = input("Enter desired hour for coversion:")

Aucun commentaire:

Enregistrer un commentaire