76,181 views
27 votes
27 votes
Given two date 01/12/2022 and 02/11/2022 compare the two using if else statement to prove that 01/12/2022 is grater than 02/11/2022

User NeverStopLearning
by
2.9k points

1 Answer

22 votes
22 votes

Answer:

date1 = "01/12/2022"

date2 = "02/11/2022"

if date1[3:5] > date2[3:5]:

print(date1, "is greater than", date2)

else:

print(date2, "is greater than", date1)

User Yura
by
2.6k points