Iterating a List Object Values in Python

 # Iterating a List Object Values in Python :

# The objects in the list can be iterated over one by one, by using a for loop

Ex:

courses=["python","Django","Flask","Pyspark"]

for x in courses:

    print(x)


# Iterate along with an index number:

Ex:

mylist = [5, 8, 'ram', 7.50, 'ravi']

for i in range(2, len(mylist)):

     print(mylist[i])


No comments:

Post a Comment

Latest Post

How to Generate Barcode and QR code For Our Products

 మీ products కి barcode / QR code generate చేయాలంటే OPTION 1: ONLINE (No Coding – Quick) Best for small shops / beginners 👉Free websites: T...