This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def outer(x, y, z=1): | |
def inner(x, y): | |
return x + y | |
return z * inner(x, y) | |
@pytest.mark.parametrize('args, expected', [ | |
pytest.param([2, 2, 1], 4), | |
pytest.param([3, 2, 1], 5), | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[submodule "frontend-subrepository"] | |
path = frontend-subrepository | |
url = git@github.com:filipgorczynski/frontend-subrepository.git | |
branch = master | |
[submodule "backend-subrepository"] | |
path = backend-subrepository | |
url = git@github.com:filipgorczynski/backend-subrepository.git | |
branch = master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/submodules-test | |
git submodule init | |
git submodule update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> print("Witaj świecie") | |
Witaj świecie | |
>>> print("Witaj 'świecie'") | |
Witaj 'świecie' | |
>>> print("Witaj \"świecie\"") | |
Witaj "świecie" | |
>>> print('Witaj świecie') | |
Witaj świecie | |
>>> print('Witaj "świecie"') | |
Witaj "świecie" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> my_str_i = "Alpha" | |
>>> my_str_ii = "Bravo" | |
>>> my_str_iii = my_str_i | |
>>> my_str_iv = "Alpha" | |
>>> hex(id(my_str_i)) | |
'0x7f5fec555960' | |
>>> hex(id(my_str_ii)) # 2 różne wartości w różnych miejscach pamięci | |
'0x7f5fe67e71f0' | |
>>> hex(id(my_str_iii)) # po przypisaniu referencji do obiektu obie zmienne wskazują to samo miejsce w pamięci | |
'0x7f5fec555960' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://pl.wikipedia.org/wiki/Pangram | |
pangram = "pChNąĆ w Tę łÓdŹ jEżA lUb OśM sKrZyŃ fIg" | |
print(pangram.capitalize()) | |
print(pangram.casefold()) | |
print(pangram.title()) | |
print(pangram.upper()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import Template | |
uczen = 'Alpha Bravo' | |
punkty = 80 | |
tpl = Template("Cześć $uczen. Uzyskałeś $punkty punktów z egzaminu.") | |
print(tpl.substitute(uczen=uczen, punkty=punkty)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uczen = "Alpha Bravo" | |
punkty = 80 | |
print(f"Cześć {uczen}. Uzyskałeś {punkty} punktów z egzaminu.") | |
print(f"2 + 2 = { 2 + 2 }") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uczen = "Alpha Bravo" | |
punkty = 80 | |
print("Cześć {}. Uzyskałeś {} punktów z egzaminu.".format(uczen, punkty)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uczen = "Alpha Bravo" | |
punkty = 80 | |
print("Cześć %s. Uzyskałeś %d punktów z egzaminu." % (uczen, punkty)) |