Skip to content

Instantly share code, notes, and snippets.

View brabemi's full-sized avatar

Miroslav Brabenec brabemi

  • The National Library of Technology
  • Czech Republic
View GitHub Profile
@brabemi
brabemi / 01_pocet_znaku.py
Created April 11, 2024 19:40
PyLadies - Praha - jaro 2024 - Lekce - Lineární a kvadratická časová složitost (2024-04-08)
# Osnova lekce - https://github.com/PetraVidnerova/PyLadies_pokr/tree/main/lesson_time
from pprint import pprint
from random import randrange
from time import time
# import string
retezec = 'skakal pes pres oves'
def vygeneruj_retezec(delka):
@brabemi
brabemi / 00_readme.md
Last active October 4, 2023 14:57
PyLadies - Praha - podzim 2023 - Lekce 4 – While & Opakování cyklů (3. 10. 2023)
@brabemi
brabemi / 00_readme.md
Last active December 12, 2022 17:02
Lekce: Třídy II & Dědičnost (2022-12-07)
@brabemi
brabemi / 00_readme.md
Last active December 3, 2022 09:41
PyLadies - Praha - podzim 2022 - Lekce 11
@brabemi
brabemi / 00_readme.md
Last active December 12, 2022 17:02
PyLadies - Praha - podzim 2022 - Lekce 7 – Procvičování & soubory (2. 11. 2022)
@brabemi
brabemi / 00_readme.md
Last active November 28, 2021 22:41
PyLadies - Praha - podzim 2021 - Lekce 4 – While & Opakování cyklů
@brabemi
brabemi / 01_funkce.py
Last active October 1, 2020 20:44
PyLadies - Praha - podzim 2020 - Lekce 3 – Funkce a cyklus For
# print("", len(""))
# print("1", len("1"))
# print("12", len("12"))
# print("1234", len("1234"))
retezec = "ahoj"
delka = len(retezec)
print(delka, delka**2)
print("delka řetězce", retezec, "je", len(retezec))
@brabemi
brabemi / 01_printy.py
Created September 24, 2020 20:11
PyLadies - Praha - podzim 2020 - Lekce 2 – Proměnné a podmínky
print("") # prázdný řetězec
print("Ahoj") # toto vytiskne Ahoj
print(1)
print(0.1)
print(1, 2, 3, 4)
print("ahoj", 1, 0.1, "konec")
print(3*4)
print("ahoj" + " to je vše")
print("ahoj" * 80)
print("Ahoj" * 80)
@brabemi
brabemi / 12_vozovy_park.py
Created May 28, 2020 18:37
PyLadies - Praha - jaro 2020 - Lekce 12 - Dědičnost
class Vozidlo:
def __init__(self, spz):
self.spz = spz.upper()
self.stav_nadrze = 0
self.najete_km = 0
def dojezd(self):
'''
Vrátí dojezd vozidla v km.
'''
@brabemi
brabemi / 01_for_a_while.py
Created April 2, 2020 19:42
PyLadies - Praha - jaro 2020 - Lekce 4 – While
from random import randrange
# Házím 6 kostkami, vypíšu nejvyšší hod
# vím kolikrát chci něco udělat -> for cyklus
maximum = 0
for hod in range(6):
hodnota = randrange(1, 7)
print(hodnota)
if maximum < hodnota:
maximum = hodnota