1
Answer

problem with while loop and print

Hi

Instead of getting e.g.

5 x 1 = 5

5 x 2 = 10 etc ...

I get:

5 x 1 = 5

5 x 2 = 55

5 x 3 = 555 etc ...

i=1
num = input("Input number: ")
while i<=10:
    res = num * i
    print(f"{num} x {i} = {res}")
    i+=1
Thanks

V

Answers (1)