for statement calls iter() on the container object : Iterators : Buildin Function PYTHON examples


PYTHON examples » Buildin Function » Iterators »

 

for statement calls iter() on the container object


for statement calls iter() on the container object



for element in [123]:
    print element
for element in (123):
    print element
for key in {'one':1'two':2}:
    print key
for char in "123":
    print char
for line in open("myfile.txt"):
    print line



           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Buildin Function
» Iterators