I'm trying to write a code which prompts the user to enter a number, then prints its ten-times tables, before moving onto another number (with sentinel value). My code here is not working. The inner while loop is not executing the second time and instead it is simply taking an input, then asking for another input, and again, and again. Any ideas on how to fix this?:
num = int() counter = int() counter = 0 counter2 = int() counter2 = 0 number = num while counter2 != -1: num = int(input("\nEnter a Number: ")) counter2 += 1 while counter <= 9 and num != 1: number = num * (counter + 1) print(number, end = " ") counter += 1 number = num * (counter + 1)
[python][python][/python][/python]