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}.
")
print("very great")

  

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

原文地址:https://www.cnblogs.com/tigergaonotes/p/14213896.html