Looking for answers? Westonci.ca is your go-to Q&A platform, offering quick, trustworthy responses from a community of experts. Join our platform to connect with experts ready to provide detailed answers to your questions in various areas. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.
Sagot :
earliest = ""
while True:
month = int(input("Enter a date (month): "))
day = int(input("Enter a date (date): "))
year = int(input("Enter a date (year): "))
if month == 0 and day == 0 and year == 0:
break
if month < 10:
month = "0"+str(month)
if day < 10:
day = "0"+str(day)
string_date = str(month)+"/"+str(day)+"/"+str(year)
print(string_date)
if earliest == "":
earliest = string_date
else:
year,month,day=int(year),int(month),int(day)
lst = list(map(int,earliest.split("/")))
if year < lst[2]:
earliest = string_date
elif year == lst[2] and month < lst[0]:
earliest = string_date
elif year == lst[2] and lst[0] == month and day < lst[1]:
earliest = string_date
print(earliest,"is the earliest date")
I wrote my code in python 3.8. Best of luck.
We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. We're here to help at Westonci.ca. Keep visiting for the best answers to your questions.