# T恤defmake_shirt(size, message):"""概要的说明T恤的尺码和字样"""print("\nT-shirt size is "+ size +".")print("The words on the T-shirt are "+ message +".")# 使用位置实参调用函数制作一件T恤
make_shirt('XL','good morning')# 使用关键字实参调用函数
make_shirt(message ='good morning', size ='XL')
8-4 大号T恤
# 大号T恤defmake_shirt(size, message ='I love Python'):"""概要的说明T恤的尺码和字样"""print("\nT-shirt size is "+ size +".")print("The words on the T-shirt are "+ message +".")# 一件印有默认字样的大号T恤
make_shirt('L')# 一件印有默认字样的中号T恤
make_shirt('M')# 一件其它字样的T恤
make_shirt('S','I love you')
8-5 城市
# 城市defdescribe_city(city, country ='iceland'):"""显示城市所属的国家"""print(city.title()+" is in "+ country.title())
describe_city('reykjavik')
describe_city('beijing','china')
describe_city(country ='china', city ='shanghai')