print 'CSP17 Introduction to Computer Logic' print 'San Joaquin Delta College' print 'Jesus Modesto Summer 2015' #get the month month = int(input('Enter the month.')) #validate the month while month < 1 or month > 12: print('ERROR: The month cannot be less than 1 or greater than 12.') month = int(input('Enter the correct month.')) #get the day day = int(input('Enter the day.')) #validate the day while day < 1 or day > 31: print('ERROR: The day cannot be less than 1 or greater than 31.') day = int(input('Enter the correct day.')) #get the year year = int(input('Enter the year.')) #validate the year while year < 0 or year > 99: print('ERROR: The year cannot be less than 00 or greater than 99.') year = int(input('Enter the correct year.')) #determine if the date is magic or not if year == month * day: print('Magic Date') else: print('Not a Magic Date')
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question