The loop of the python dictionary takes the key by default

Dictionary loop takes key example by default
 
dict={'name':'john','number':'201801','weight':'80kg','tall':'180cm"}
#------Direct loop dictionary takes key by default------
for i in dict:
print(i)
#----- can also cycle key---------
for i in dict(keys):
print(i)
#------loop value---------------
for i in dict(values):
print(i)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324861144&siteId=291194637