3 changed files with 46 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||||
|
print("Vitejte v rychloKalku(kva)lačka") |
||||
|
|
||||
|
a = int(input("cislo a:")) |
||||
|
b = int(input("cislo b:")) |
||||
|
|
||||
|
print(f"{a}+{b}={a+b}") |
||||
|
print(f"{a}-{b}={a-b}") |
||||
|
print(f"{a}*{b}={a*b}") |
||||
|
print(f"{a}/{b}={a/b}") |
||||
@ -0,0 +1,20 @@ |
|||||
|
x = 10 |
||||
|
y = 15 |
||||
|
|
||||
|
#AltGR + ,/. = <> |
||||
|
if x==y: |
||||
|
print("X je stejný s Y") |
||||
|
elif x < y: |
||||
|
print("X je menší než Y") |
||||
|
else: |
||||
|
print("X je větší než Y") |
||||
|
|
||||
|
#for loop -> cyklus který potřebuje <něco> s čím bude pracovat |
||||
|
for x in range(10): |
||||
|
print(x) |
||||
|
|
||||
|
#while loop -> cyklus který se opakuje dokud <podmínka> je true |
||||
|
i = 1 |
||||
|
while i<10: |
||||
|
print(i) |
||||
|
i+=1 |
||||
@ -0,0 +1,17 @@ |
|||||
|
maklic = False #toto je bool proměnná |
||||
|
|
||||
|
while True: |
||||
|
print("jsi pred dverma co udelas?") |
||||
|
print("1) otevru dvere") |
||||
|
print("2) pouziju klic") |
||||
|
volba = input("co udelas 1/2:") |
||||
|
|
||||
|
if volba == "1": |
||||
|
if maklic: |
||||
|
print("otevřel jsi dvere") |
||||
|
exit(0) |
||||
|
else: |
||||
|
print("Nejde to, je to zavřené") |
||||
|
if volba == "2": |
||||
|
maklic = True |
||||
|
print("máš klíč") |
||||
Loading…
Reference in new issue