python學習第4周(2)

#8-1
def display_message():
print("I learn function in this chapter.")
display_message()
#8-5
def describe_city(city_name, country = "China"):
print(city_name + " is in " + country)
describe_city("Guangzhow")
describe_city("Paris", "French")
describe_city("New York", "America")


#8-6
def city_country(city_name, country):
return city_name + " " + country
print(city_country("Guangzhou", "China"))
print(city_country("Paris", "French"))
print(city_country("New York", "America"))


#8-9
def show_magicians(magicians):
for magician in magicians:
print(magician)
show_magicians(["Liu Qian", "Chen Shen"])

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章