Computer Science, asked by rajwatiyadav5, 1 day ago

Write a program in Python to print the table of a number using ‘for’ loop.​

Answers

Answered by MichMich0945
1

Program:

# Python program to print a multiplication table of

# a number inputted at runtime

# Ask the user to enter a number.

num = int(input("Enter number: "))

# Print the multiplication table of the provided number

# using a for loop

for x in range(1, 11):

   print(num, "x", x, "=", num * x)

Explanation:

  1. We ask the user to input a number.
  2. When they input a number we assign it to variable num.
  3. Later, we for loop from 1 to 10 to get the divider.
  4. And print the number multiplied by the number provided by the for-loop.

Output is provided in the attachments!

Hope this helps you!

Attachments:
Answered by SOOP2
1

Answer:

Hope this helped you if yes then pls mark me as brainliest.

Attachments:
Similar questions