This file contains hidden or 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
'''題目1''' | |
weekdays = ['Mon','Tue','Wed','Thu','Fri'] | |
def good_print_weekday( num, weekdays ): | |
if num > 5: | |
print 'index too large' | |
else: | |
print weekdays[ num - 1] |
This file contains hidden or 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
def umbrella_check( p ): | |
if p > 50: | |
print 'remember your umbrella' | |
else: | |
print 'no need umbrella' | |
umbrella_check( 30 ) #no need umbrella | |
umbrella_check( 51 ) #remember your umbrella | |
def good_umbrella_check( p ): |
This file contains hidden or 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
'''restaurant.py | |
Designing some problems for | |
Intro to Computer Science Lesson 1 ~ Lesson 3 Review Question Code | |
Course Source: https://www.udacity.com/course/viewer#!/c-cs101 | |
''' | |
menu = [ [ "大麥克" , "牛肉, 酸黃瓜, 起士" , 109 ], | |
[ "麥香魚" , "鱈魚, 起士, 美乃滋" , 99 ], | |
[ "麥香雞" , "雞肉, 生菜, 美乃滋" , 89 ] ] |
NewerOlder