A basic course of programming for first-year students of mathematics. The course covers programming in Python,
basic algorithms and data structures and practical program design and debugging.
Last update: Töpfer Pavel, doc. RNDr., CSc. (25.09.2019)
Seminář pro 1. ročník bakalářského studia matematiky. Obsahem kursu jsou základy programování v jazyce
Python.
Last update: Kaplický Petr, doc. Mgr., Ph.D. (30.05.2019)
Course completion requirements -
Students will receive a credit for this course by active participation in the practice sessions in the computer lab. Credit is awarded based on demonstrating the ability to independently design, implement and modify program solutions, whereby an independent design is understood as the creation of an algorithm and program without the use of tools for automatic code generation.
To obtain a credit, the following is required:
active participation in exercises consisting of solving tasks (programs) within the deadlines set by the instructor (whether at the exercise or at home). At least 70% of points for continuously assigned homework are required. The teacher may set the conditions under which the student can replace missing points with homework.
successful completion of written tests assigned in person at exercises during the semester. In case of failure, the student has the opportunity to retake each of these written tests once.
Last update: Töpfer Pavel, doc. RNDr., CSc. (30.07.2026)
Předmět je zakončen zápočtem. Zápočet je udělován na základě prokázání schopnosti samostatně navrhovat, implementovat a upravovat programová řešení, přičemž samostatným návrhem se rozumí vlastní tvorba algoritmu a programu bez využití nástrojů pro automatické generování kódu.
K získání zápočtu se požaduje
aktivní účast na cvičeních spočívající v řešení úkolů (programů) v termínech stanovených cvičícím (ať už na cvičení nebo doma). Požaduje se získání alespoň 70% bodů za průběžně zadávané domácí úkoly, přičemž vyučující může stanovit podmínky, za nichž student může nahradit chybějící body za domácí úkoly.
úspěšné absolvování písemných testů zadávaných prezenčně na cvičeních během semestru. V případě neúspěchu má student možnost jedné opravy každého z těchto písemných testů.
Last update: Töpfer Pavel, doc. RNDr., CSc. (30.07.2026)
Literature -
John V. Guttag, Introduction to Computation and Programming Using Python: With Application to Understanding Data, 2nd ed.,, MIT Press, Cambridge, MA 2016
Allen B. Downey, Think Python: How to Think Like a Computer Scientist, 2nd ed., O'Reilly Media, Sebastopol, CA 2015
Last update: Töpfer Pavel, doc. RNDr., CSc. (29.10.2019)
John V. Guttag, Introduction to Computation and Programming Using Python: With Application to Understanding Data, 2nd ed.,, MIT Press, Cambridge, MA 2016
Allen B. Downey, Think Python: How to Think Like a Computer Scientist, 2nd ed., O'Reilly Media, Sebastopol, CA 2015
Last update: Töpfer Pavel, doc. RNDr., CSc. (30.08.2019)
Syllabus -
Python programming language
Python as a calculator
integers
float numbers and accuracy problems
operators and their priorities
assignment
conditions and cycles (while)
program structure: comments, indentation
basic input() and print()
program debugging, using the development environment
for loop, range()
break, continue
lists used as fields
the list assignment assigns only the link
function definition and function call
optional parameters
abstraction and modularity of programs
local identifiers and their visibility
lists and their operations
iterating over a list
cuts
list comprehension
string
tuples
dictionaries and operations with them
exceptions and their catching
working with files
use of libraries, import
standard library
Basic algorithms
decomposition of numbers into digits
Euclidean algorithm
prime numbers calculated by dividing till the square root
factorization
the k’th smallest element computed in time k*n
matrix multiplication
Last update: Töpfer Pavel, doc. RNDr., CSc. (27.05.2026)
Základy programovacího jazyka Python
Python jako kalkulačka
celá čísla
float a problémy s přesností
operátory a jejich priority
přiřazení
základní podmínky a cykly (while)
struktura programu: komentáře, odsazování
triviální input() a print()
ladění programu, používání vývojového prostředí
for cykly, range()
break, continue
seznamy používané jako pole
přiřazení seznamu přiřazuje pouze odkaz
definice a volání funkcí
nepovinné parametry
abstrakce a modularita programů
lokální identifikátory a jejich viditelnost
seznamy a operace s nimi
iterování přes seznam
řezy
list comprehension
string
n-tice (tuples)
slovníky a operace s nimi
výjimky a jejich odchytávání
práce se soubory
používání knihoven, import
standardní knihovna
Základní algoritmy
rozklad čísla na číslice
Eukleidův algoritmus
prvočísla dělením do odmocniny
faktorizace
k-tý nejmenší prvek v čase k*n
násobení matic
Last update: Töpfer Pavel, doc. RNDr., CSc. (27.05.2026)