jiayu -for循环

# 代码的精髓:解决重复劳动力
# for循环
# for 变量名 in 集合:
#    需要重复执行的语句

# 1-100:
# 1+2+3+4+。。。。。100
w=0
for i in range(100000):
    w=w+i
print(w)




import turtle
wd=100
nd=85
turtle.speed(0)
for w in range(1000):
    # circle
    turtle.circle(w)
    turtle.lt(90)
    # turtle.fd(w) # w: 0 1 2 3 4 5 6 7 ... 999
turtle.done()
发布了305 篇原创文章 · 获赞 18 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/houlaos/article/details/104156591