This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Luke , Python , 9/17/2014 | |
month = raw_input("Month: ").lower() # asks what month it is and forces the entry to be in lower case so that it matches with my list entries | |
# when you put things in "" it makes it print | |
year = int(raw_input("Year: ")) # asks for year and the int() requires the entry to be a number | |
month30 = ["september", "april", "june", "november"] # all the months with 30 days | |
month31 = ["january", "march", "may", "july", "august", "october", "december"] # all months with 31 days | |
month29 = ["february"] #month with 28 /w no leap and 29 with leap | |
# elif means "else if" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 0 | |
print "Which is better? Coke Zero or Water?" | |
answer1 = raw_input("Answer: ").lower() | |
if answer1 == "coke zero": | |
print "Correct!" | |
x += 1 | |
else: | |
print "Wrong!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Which is better? Coke Zero or Water?" | |
answer1 = raw_input("Answer: ").lower() | |
if answer1 == "coke zero": | |
print "Correct!" | |
else: | |
print "Wrong!" | |
print "Does Luke like climbing?" | |
answer2 = raw_input("Answer: ").lower() | |
if answer2 == "yes": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Luke , Python , 9/17/2014 | |
month = raw_input("Month: ").lower() | |
year = int(raw_input("Year: ")) | |
month30 = ["september", "april", "june", "november"] | |
month31 = ["january", "march"] | |
month29 = ["february"] | |
if month in month30: |
NewerOlder