Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- date = input()
- while date:
- if date == '0 0 0':
- break
- date = date.split(' ')
- date = [int(d) for d in date]
- if date[0] > 31:
- print('Invalid')
- elif date[0] == 31:
- if date[1] == 1 or date[1] == 3 or date[1] == 5 or date[1] == 7 or date[1] == 8 or date[1] == 10 or date[1] == 12:
- print('Valid')
- else:
- print('Invalid')
- elif date[0] == 30:
- if date[1] == 2:
- print('Invalid')
- elif date[1] == 2:
- if date[0] == 29:
- if date[2] % 4 == 0:
- print('Valid')
- else:
- print('Invalid')
- else:
- print('Valid')
- else:
- print('Valid')
- date = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement