python for循环

#!/usr/bin/python
#coding=utf-8
#好好学习,天天向上
magicians=['alice','david','candy']
for magician in magicians:
    print(f"{magicians},that was a great trick!")
    print(f"i can not wait to see your next trick,{magicians}.\n")
print("very great")

  

 

 备注:最后一个print没有缩进,所以为集体最后一次打印,前两次都有缩进,表示在for循环中执行

posted @ 2020-12-30 22:33  tigergaonotes  阅读(99)  评论(0编辑  收藏  举报