<jupyter_start><jupyter_text>Arithmetic Operators<jupyter_code>assert False
assert False, 'The statement is False!'
assert True
assert 10 - 2 == 8 # 10 minus 2 equals 8
5 + 3, '5' + '3'
# will concatenate the lists into a new list
[1,2,3] + [1]
assert 2 * 3 == 6
assert round(2 * 3.3000000000001, 1) == 6.6
assert 2 * (3, 4, 5, 6, 7) == (3, 4, 5, 6, 7) + (3, 4, 5, 6, 7)
assert 2 * [3, 4, 5, 6, 7] == [3, 4, 5, 6, 7] + [3, 4, 5, 6, 7]
assert 5 / 3 == 1.6666666666666667
assert 8 / 4 == 2
assert isinstance(8 / 4, float)
8 / 4 == 2.0 == 2 == 3
8 % 4, 8 % 3, 8 % 1, 8 % 5
x, y = 8, 3
x, y
divmod(x, y), (x//y, x%y)
x, y = 8, 5
x, y
divmod(x, y), (x//y, x%y)
'{}!'.format('Metin'), '{}, {}!'.format('Hello', 'Metin')
'%s!' % 'Metin', '%s, %s!' % ('Hello', 'Metin')
'The value is {:10}!'.format(100)
'The value is %10s!' % 100
assert 5 & 3 == 1<jupyter_output><empty_output><jupyter_text>Assignment Operators<jupyter_code>n = 1
c = 10
y = 100
z = 100
for i in range(5):
    n += 1 # n = n + 1
    c -= 2 # c = c - 2
    y /= 3 # y = y / 3
    z //= 3 # z = z // 3    
n, c, y, z
!python --version
# this will not work if you don't have python 3.9
# set value within if condition
for letter in ('A', 'B', 'C'):
    if (value := 'A') == letter:
        print(value + letter)<jupyter_output>AA<jupyter_text>Execution Model<jupyter_code># get an input and do some operation
x = int(input("Please enter an integer: "))

if x < 0:
    x = 0
    print('Negative changed to zero')
elif x == 0:
    print('Zero')
elif x == 1:
    print('Single')
else:
    print('More')
n = 0
while n < 5:
    print(n, n < 5)
    n += 1
print(n, n < 5)
def generator_function():
    yield 123
g = generator_function()
next(g)
next(g)
while True:
    n = int(input('enter a value: '))
    if n == 2:
        break
    else:
        print('wrong value!')
for letter in 'my string':
    print(letter)
users = {
  'Mike': 1,
  'John': 2,
  'Smith': 3,
  'Susanne': 4,
}

users.keys(), users.values()

for key in users.keys():
    print(key)
[key for key in users.keys()]
try:
    value = int(input('Enter an integer value: '))
    
    if value == 3:    
        value / 0
    elif value in '2 sample strings':
        print('Yey your value is 2.')
        
except (TypeError, ValueError):
    print('TypeError or ValueError occured')
except ZeroDivisionError:
    print('ZeroDivisionError occured')
except:
    print('Error occured')
while True:
    try:
        x = int(input("Please enter a number: "))
        if x > 20:
            break
    except ValueError:
        print("Oops!  That was no valid number.  Try again...")<jupyter_output>Please enter a number: 2
Please enter a number: 3
Please enter a number: 4
Please enter a number: 5
Please enter a number: 6
Please enter a number: 4
Please enter a number: 23
{'fraction_non_alphanumeric': 0.16798277099784636, 'fraction_numerical': 0.06281407035175879, 'mean_word_length': 2.7970027247956404, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '647105', 'license': 'MIT', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1065, 'n_words': 394, 'path': 'weeks/week-05/Tutorial.ipynb', 'repo_name': 'spu-python-203/class-materials', 'size': '2786'}