#8-1
def display_message(chapter):
print("You are learning about "+str(chapter)+" now!")
display_message('function')
#8-2
def favorite_book(title):
print("One of my favorite books is "+title)
favorite_book('Python')
#8-3
def make_shirt(size,word):
print("T-shirt's size is "+size+" and word is "+word)
make_shirt('43','haha')
make_shirt(word='abc',size='44')
#8-4
def make_shirt(size,word="I love Python"):
print("T-shirt's size is "+size+" and word is "+word)
make_shirt('big')
make_shirt(size='default')
make_shirt(size='default',word='HAHA')
#8-5
def describe_city(city,country='China'):
print(city+" is in "+
Python编程从入门到实践-第八章动手试一试
最新推荐文章于 2023-05-01 11:40:02 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)