Python入门习题大全——索引
编写一个名为favorite_book()的函数,其中包含一个名为title的形参。这个函数打印一条消息,如One of my favorite books is Alice in Wonder land。调用这个函数,并将一本图书的名称作为实参传递给它。
# 喜欢的图书
def favorite_book(title):
print("One of my favorite books is " + title.title() + ".")
favorite_book('hahaha')
输出为:
One of my favorite books is Hahaha.