Python自學:第四章 在for循環中執行更多操做(1)

# -*- coding: GBK -*-
magicians = ['alice', 'david', 'carolina']
for magician in magicians:

    print(magician.title() + ", that was a great trick!")

輸出爲:python

Alice, that was a great trick!
David, that was a great trick!
Carolina, that was a great trick!
相關文章
相關標籤/搜索