Grow your YouTube channel like a PRO with a free tool
Get Free YouTube Subscribers, Views and Likes

Learn Python ITERABLES in 6 minutes! 🔂

Follow
Bro Code

#python #pythontutorial #pythonprogramming
Iterables = An object/collection that can return its elements one at a time,
allowing it to be iterated over in a loop

my_list = [1, 2, 3, 4, 5]
my_tuple = (1, 2, 3, 4, 5)
my_set = {"apple", "orange", "banana", "coconut"}
my_name = "Bro Code"
my_dictionary = {'A': 1, 'B': 2, 'C': 3}

for item in my_list:
print(item)

DICTIONARIES
for key in my_dictionary:
print(key)

for value in my_dictionary.values():
print(value)

for key, value in my_dictionary.items():
print(f"{key} = {value}")

posted by ostaklimh0