Python自学:第四章 在for循环结束后执行一些操作


# -*- 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")

print("Thank you, everyone.That was great magic show!")

输出为

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.

Thank you, everyone.That was great magic show!

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM