Sunday, March 3, 2019

Simple Enhanced Loop - Python3

list1 = [10,20,30,40,50]

print("From simple for loop")
for i in range(len(list1)):
    print (list1[i])

print("From enhanced for loop")
for i in list1:
    print (i)

ScreenShot:

No comments:

Post a Comment