for name in names :
print (name)
data = [1,2,3,4,5,6,7,8,9,10]
data = list(range(11))
print (data)
s=0
for n in data:
for n in range(11):
s = s + n
print ('s=%d'%s)
#根據key獲取value
score = name_scores['xiaobai']
print ('score=%d'%score)
#get()獲取不到對應的value時 ,則返回None
score = name_scores.get('whj')
print ('score=%s'%score)
#添加鍵值對
name_scores ['bailina'] = 100
print (name_scores)
#修改
name_scores['bailina'] = 90
print (name_scores)
#刪除
name_scores.pop('bailina')
print(name_scores)
def coordinate (x,y,lenth,angle):
x1 = x + lenth*math.cos(angle)
y1 = y - lenth*math.sin(angle)
return x1,y1
#如果試圖在return語句中返回多個值
#程序自動將這多個值封裝為一個元組
PI = 3.1415926
result = coordinate(5,10,10,PI/6)
print (result)
x,y=(1,2)
print (x,y)