Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions 3.9/dict_ior1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
x = {"key1": "value1 from x", "key2": "value2 from x"}
y = {"key2": "value2 from y", "key3": "value3 from y"}
print(x | y)
# {'key1': 'value1 from x', 'key2': 'value2 from y', 'key3': 'value3 from y'}
print(y | x)
# {'key2': 'value2 from x', 'key3': 'value3 from y', 'key1': 'value1 from x'}
6 changes: 6 additions & 0 deletions 3.9/dict_ior2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
x = {"key1": "value1 from x", "key2": "value2 from x"}
y = {"key2": "value2 from y", "key3": "value3 from y"}
x |= y

print(x)
print(y)
9 changes: 9 additions & 0 deletions 3.9/hints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import List # WHY?)


def print_all(names: list[str]) -> None:
for name in names:
print("Hello", name)


print_all(['Flyaps', 'Google', 'Apple'])
13 changes: 13 additions & 0 deletions 3.9/str_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
string = '12|34|56'

string = string.removeprefix('34') # No effect
print(string) # 12|34|56

string = string.removeprefix('12')
print(string) # |34|

string = string.removesuffix('56')
print(string) # |34|

string = string.removesuffix('34') # No effect
print(string) # |34|