Sylvia^^

导航

列表的应用

import turtle
turtle.speed(10)
colors = ['red','purple','blue','green','yellow','orange','pink']

for i in range(200):
    turtle.pencolor(colors[i%7])
    turtle.forward(i)
    turtle.left(59)

turtle.done()

name = ['Lucas','Ava','Tracy']  #list
print(name[1])
scores = [95,75,85]  #list

d = {'Lucas':95,'Ava':75,'Tracy':85}  #dict
d['Ava']=88
d['Lisa']=78
d.pop('Lucas')
print(d)

att = {'name': '201709080070许佳婷','LateTime':0,'onTime':6,'workTime':7}
print(att['workTime'])

posted on 2018-06-04 16:33  Sylvia^^  阅读(118)  评论(0编辑  收藏  举报