-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e98078
commit 962cf66
Showing
2 changed files
with
120 additions
and
55 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,16 +35,12 @@ | |
" * mgr inż. Zbigniew Kaleta, [email protected]\n", | ||
" * dr inż. Marek Gajęcki, [email protected]\n", | ||
" \n", | ||
"* Konsultacje: https://wiki.ki.agh.edu.pl/pages/viewpage.action?pageId=9502795\n", | ||
"\n", | ||
"* Współautorzy materiałów: \n", | ||
" * dr inż. Krzysztof Dorosz, [@krzysztofdorosz](https://twitter.com/krzysztofdorosz)\n", | ||
" * dr inż. Michał Korzycki, [@michalkorzycki](https://twitter.com/michalkorzycki)\n", | ||
" * dr Leszek Grzanka, [@leszekgrzanka](https://twitter.com/leszekgrzanka)\n", | ||
"* Slajdy udostępnione w formacie Jupyter Notebook na githubie https://github.com/agh-glk/python-lecture\n", | ||
"* Na pewno nie unikniemy gdzieś błędu w materiałach wykładu, dlatego gorąco zachęcamy do zgłaszania poprawek na githubie (fork + pull request)\n", | ||
"* Wykłady: 2 III, 9 III, 16 III, 23 III, 30 III, 13 IV, 1 VI \n", | ||
"* Laboratoria na przemian" | ||
"* Slajdy udostępnione w formacie Jupyter Notebook na githubie https://github.com/agh-glk/python-lecture (warto zainstalować rozszerzenie RISE)\n", | ||
"* Na pewno nie unikniemy gdzieś błędu w materiałach wykładu, dlatego gorąco zachęcamy do zgłaszania poprawek na githubie (fork + pull request)" | ||
] | ||
}, | ||
{ | ||
|
@@ -65,11 +61,35 @@ | |
"\n", | ||
"### Terminy oddania projektu:\n", | ||
"* podstawowy: ostatnie zajęcia własnej grupy w semestrze\n", | ||
"* poprawkowy: koniec letniej sesji egzaminacyjnej (15 września)\n", | ||
"* poprawkowy: koniec letniej sesji egzaminacyjnej (16 września)\n", | ||
"\n", | ||
"### Terminy kolokwiów:\n", | ||
"* podstawowy: 1 VI\n", | ||
"* poprawkowy: 15 czerwca **albo** 7 września o 14:00 (albo = xor)" | ||
"* podstawowy: 6. laboratorium\n", | ||
"* poprawkowy: 24 VI **ALBO** 9 IX (albo = xor)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"slideshow": { | ||
"slide_type": "subslide" | ||
} | ||
}, | ||
"source": [ | ||
"Wykład co 2. tygodnie." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"slideshow": { | ||
"slide_type": "fragment" | ||
} | ||
}, | ||
"source": [ | ||
"A co na laboratoriach?\n", | ||
"\n", | ||
"https://forms.gle/FzR25vXgqUJ3EDah6" | ||
] | ||
}, | ||
{ | ||
|
@@ -103,19 +123,16 @@ | |
} | ||
}, | ||
"source": [ | ||
"### Zalety:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Zalety:\n", | ||
"\n", | ||
" * zwięzły\n", | ||
" * czytelny (duża ekspresja)\n", | ||
" * bardzo dużo zasobów: frameworków, bibliotek, tutoriali\n", | ||
" * bardzo popularny (3.~4. miejsce w rankingu TIOBE index, wg. GitHuba poniżej)\n", | ||
" \n", | ||
"za https://hackernoon.com/top-3-most-popular-programming-languages-in-2018-and-their-annual-salaries-51b4a7354e06" | ||
" * bardzo popularny\n", | ||
"\n", | ||
"https://madnight.github.io/githut/#/\n", | ||
"\n", | ||
"https://www.tiobe.com/tiobe-index/" | ||
] | ||
}, | ||
{ | ||
|
@@ -126,13 +143,8 @@ | |
} | ||
}, | ||
"source": [ | ||
"### Wady:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Wady:\n", | ||
"\n", | ||
"* prędkość\n", | ||
"* Global Interpreter Lock\n", | ||
"* niekompatybilne linie 2.x i 3.x" | ||
|
@@ -210,7 +222,7 @@ | |
" * tylko Unicode\n", | ||
" * nowy operator dzielenia /\n", | ||
" * nowa składnia raise/except\n", | ||
"* Na wykładzie korzystamy z linii 3.8.x" | ||
"* Na wykładzie korzystamy z linii 3.9.x" | ||
] | ||
}, | ||
{ | ||
|
@@ -461,6 +473,43 @@ | |
"wartosc1 if warunek else wartosc2" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"slideshow": { | ||
"slide_type": "subslide" | ||
} | ||
}, | ||
"source": [ | ||
"## MATCH-CASE\n", | ||
"\n", | ||
"dostępny od wersji 3.10\n", | ||
"\n", | ||
"https://towardsdatascience.com/the-match-case-in-python-3-10-is-not-that-simple-f65b350bb025" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"slideshow": { | ||
"slide_type": "fragment" | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"def http_status(status):\n", | ||
" match status:\n", | ||
" case 400:\n", | ||
" return \"Bad request\"\n", | ||
" case 401 | 403:\n", | ||
" return \"Authentication error\"\n", | ||
" case 404:\n", | ||
" return \"Not found\"\n", | ||
" case _:\n", | ||
" return \"Other error\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
|
@@ -1076,9 +1125,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"a = \"1\"\n", | ||
"a = a + 3\n", | ||
"a" | ||
"\"1\" + 3" | ||
] | ||
}, | ||
{ | ||
|
@@ -1087,9 +1134,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"a = \"1\"\n", | ||
"a = a + str(3)\n", | ||
"a" | ||
"\"1\" + str(3)" | ||
] | ||
}, | ||
{ | ||
|
@@ -1098,9 +1143,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"a = \"1\"\n", | ||
"a = int(a) + 3\n", | ||
"a" | ||
"int(\"1\") + 3" | ||
] | ||
}, | ||
{ | ||
|
@@ -1277,7 +1320,7 @@ | |
"- typ: `int`\n", | ||
"- zakres: nieograniczony\n", | ||
"- operatory: `+`, `-`, `*`, `/`, `//`, `%`, `**`, `&`, `|`, `^`, `~`, `<<`, `>>`\n", | ||
"- sposoby zapisu: 100, 0b100, 0o100, 0x100" | ||
"- sposoby zapisu: 100, 0b100, 0o100, 0x100, 1_000_000" | ||
] | ||
}, | ||
{ | ||
|
@@ -1704,7 +1747,9 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"def foo():\n", | ||
|
@@ -2083,6 +2128,7 @@ | |
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"scrolled": true, | ||
"slideshow": { | ||
"slide_type": "subslide" | ||
} | ||
|
@@ -2334,6 +2380,7 @@ | |
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"scrolled": true, | ||
"slideshow": { | ||
"slide_type": "fragment" | ||
} | ||
|