
Hi Everyone! Welcome to Cool Python Projects!
In this post I will be showing you how to make a Leap Year project that tells you when the next leap year will be. Please remember to follow me to stay updated on any new projects.
Python Code:
print("In this app you will know when the next leap year is this year a leap year.")what_is_leap_year=input("Do you know what a leap year is? a)YES or b)NO? ")ifwhat_is_leap_year=='a':print("Awesome!")elifwhat_is_leap_year=='b':print("I will tell you.")print("A leap year happens every 4 years when February has 29 days, understand.")print()print("Next I will tell you if it is a leap year now.")what_year=int(input("What year is it? "))division=(float(what_year/4))ifdivision.is_integer():print('The year {} is a leap year'.format(what_year))else:print("It is not a leap year.")division_int=int(division)forxinrange(2):next_division=division_int+1next_leap_year=next_division*4print('The next leap year will happen in {}'.format(next_leap_year))division_int=division_int+1print("I hope you liked this calendar game!")
I hope you enjoyed this Python project.
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse