
正文
Python自学:第四章 在for循环中执行更多操作(2)
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
# -*- coding: GBK -*-
magicians = ['alice', 'david', 'carolina']
for magician in magicians: print(magician.title() + ", that was a great trick!")
print("I can't wait to seee your next trick," + magician.title() + ".\n")
输出为:
Alice, that was a great trick!
I can't wait to seee your next trick,Alice.David, that was a great trick!
I can't wait to seee your next trick,David.Carolina, that was a great trick!
I can't wait to seee your next trick,Carolina.







