Skip to content

Instantly share code, notes, and snippets.

View liuderchi's full-sized avatar
🔍
Looking for inspirations

TC Liu liuderchi

🔍
Looking for inspirations
View GitHub Profile
'''題目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]
@liuderchi
liuderchi / wk2-review.py
Created November 30, 2015 14:39
wk2-python-review
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 ):
'''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 ] ]