cycle

The most commonly used looping structure is the for loop, which iterates over members of a container.

#String loop 
a= " hello world " 
for i in a:
     print (i)
 #List loop 
b=[ " sfdjh " , ' fdjkfd ' , ' jdjdj ' ]
 for j in b:
     print (j
 ) #dictionary A loop of 
person={ " name " : " jing " , " age " :25 }
 for key in person:
    print(key,person[key])

 

Guess you like

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