You are required to write a program in Python for creating a table using a while loop.
You are required to write a program in Python for creating a table using a while loop. The program will take a number as input from the user and print a table of the number as an output.
Solution:
number = int(input("Enter a number: "))
print("Table of", number, ":")
counter = 1
while counter <= 10:
result = number * counter
print(number, "x", counter, "=", result)
counter += 1
No comments