# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

my_list = [1,2,3,4,5,6,7,8,9,10]

for num in my_list:
    print(num)

for num in my_list:
    # Check for even
    if num % 2 == 0:
        print(num)
    else:
        print(f"Odd Number: {num}")

# +
list_sum = 0

for num in my_list:
    list_sum = list_sum + num
    
print(list_sum)
# -

my_string = 'Hello World'
for letter in my_string:
    print(letter)

# +
tup = (1,2,3)

for item in tup:
    print(item)
# -

mylist = [(1,2),(3,4),(5,6),(7,8)]

len(mylist)

for item in mylist:
    print(item)

# +
# Tuple and paking, using this when we need just one of the elements in the tuple
# -

for (a,b) in mylist:
    print(a)
    print(b)

mylist = [(1,2,3,),(4,5,6),(7,8,9,)] 

for a,b,c in mylist:
    print(a)
    print(b)
    print(c)

# Interating through a dictionary


# +
d = {'k1':1, 'k2':2, 'k3':3}

for item in d.items():
    print(item)

# +
d = {'k1':1, 'k2':2, 'k3':3}

for key, value in d.items():
    print(value)
# -



StarcoderdataJupyterScriptsDedupFiltered