Skip to content

Instantly share code, notes, and snippets.

@piyush2896
Created October 25, 2018 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piyush2896/44b414333111e4023d5e19750def8dee to your computer and use it in GitHub Desktop.
Save piyush2896/44b414333111e4023d5e19750def8dee to your computer and use it in GitHub Desktop.
no = int(input('Enter a positive number: '))
if no % 2 == 0:
print(no, 'is even.')
else:
print(no, 'is odd')
year = int(input('Enter an year: '))
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
print('Year', year, 'is a leap year')
else:
print('Year', year, 'is not a leap year')
else:
print('Year', year, 'is a leap year')
else:
print('Year', year, 'is not a leap year')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment