Files
eidp-2024/Tutorium/tut05/src/program.py
2024-11-17 04:48:22 +01:00

20 lines
430 B
Python

def multiply(a: int, b: int) -> int:
x, y, p = a, b, 0
while x > 0:
p = p + y
x = x - 1
return p
def run() -> None:
while True:
a = input("Bitte geben Sie eine Zahl oder exit ein:\n> ")
if a == "exit":
break
b = input("Bitte geben Sie eine weitere Zahl ein:\n> ")
print(f"{a} * {b} = {multiply(int(a), int(b))}")
if __name__ == '__main__':
run()