已采納回答 / 慕慕7454547
>>> d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}>>> for items in d:...? ? ?value=d[items]... print(items,value)
2020-09-25
已采納回答 / 慕慕7454547
可能符號(hào)從左往右計(jì)量, 首''''從前面計(jì)量了三個(gè)是指令開始,多一個(gè)就'就當(dāng)做是要輸出的字符串;尾''''從前面計(jì)量了三個(gè),按理來說已經(jīng)是完整的指令了,最后尾巴多出來的'就不能識(shí)別了。(我也是才看了幾節(jié)課,錯(cuò)了勿怪)
2020-09-25
已采納回答 / 真實(shí)如煙
names1=['Alice','Bob','Candy','David','Ellena']names2=['Gen','Phoebe','Zero']for item in names2:? ? names1.append(item)print(names1)
2020-09-24
已采納回答 / 0202yyt
因?yàn)榍衅前磸淖蟮接宜?,左邊是啟始下?biāo),右邊是結(jié)束下標(biāo)。所以倒敘你得print(L[-3:-1]),表示從倒數(shù)第三個(gè)切到倒數(shù)最后一個(gè)
2020-09-24
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
if not s1.isdisjoint(s2):
for i in s1:
if i in s2:
print(i)
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
if not s1.isdisjoint(s2):
for i in s1:
if i in s2:
print(i)
2020-09-23