#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}")
Continue this lesson in the app
Install CourseHive on Android or iOS to keep learning while you move.