|

楼主 |
发表于 2019-8-24 01:54:06
|
显示全部楼层
教科书的话是下面这样子 其实我的意思是:想最后这句:Thank you,everyone. That was a great magic show!不要循环 大神麻烦了!!!!!!!!!!!!
magicians = ["alice","david","carolina"]
for magician in magicians:
print(magician.title() + ", that was a great trick!")
print("I can't wait to see your next trick, " + magician.title() + ".\n" )
print("Thank you,everyone. That was a great magic show!")
我们在前面看到了,开头两条print语句针对列表中每位魔术师重复执行。然而,由于第三条print语句没有缩进,因此只执行一次:
Alice, that was a great trick!
I can't wait to see your next trick, Alice.
David, that was a great trick!
I can't wait to see your next trick, David.
Carolina, that was a great trick!
I can't wait to see your next trick, Carolina.
Thank you,everyone. That was a great magic show! |
|