Valerie Meunier

Valerie Meunier

  • 825
  • 693
  • 73.5k

problem with while loop and print

Mar 21 2023 11:21 AM

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)