|
|
|
@ -1,4 +1,11 @@
|
|
|
|
|
|
|
|
|
|
# takze tohle je implementace
|
|
|
|
|
# skriptu ktery umocnuje cisla
|
|
|
|
|
# bez pouziti operatoru `**`
|
|
|
|
|
# je to uprimne trochu gay a
|
|
|
|
|
# ve skutecnosti byste tohle nikdy
|
|
|
|
|
# nepouzili, ale hezky to ukazuje praci
|
|
|
|
|
# s loopama
|
|
|
|
|
|
|
|
|
|
# ziskame zaklad
|
|
|
|
|
a = int(input("zadejte zaklad : "))
|
|
|
|
@ -17,10 +24,13 @@ prod = 1 # do tyhle promenny to budeme vsechno nasobit
|
|
|
|
|
# proste by nam pohltila cely nasobeni a vysledek
|
|
|
|
|
# by byl nula
|
|
|
|
|
|
|
|
|
|
while i < e:
|
|
|
|
|
while i < e: # loopujeme tolikrat kolik je exponent
|
|
|
|
|
|
|
|
|
|
prod *= a
|
|
|
|
|
prod *= a # nasobime cislo samym sebou
|
|
|
|
|
# ekvivalent
|
|
|
|
|
# prod = prod * a
|
|
|
|
|
|
|
|
|
|
i += 1
|
|
|
|
|
i += 1 # pricitame iterator aby to fungovalo
|
|
|
|
|
|
|
|
|
|
print(prod)
|
|
|
|
|
# vypisujeme vysledek
|
|
|
|
|
print(f"vysledek : {prod}")
|
|
|
|
|