Task is this one :
Write a script that takes a number from a user’s input and prints out its multiplication table from 1 to 10.
The steps are as follows:
Open the file named main.py in your editor.*
On the first line, add a docstring explaining what your file does. Then, assign a variable called number to the user’s input and cast it to an integer.*
Next, print 20 underscores as the top border of the table.*
Multiply your number with each number from 1 to 10 and print that out.*
Finally, print 20 underscores again for the bottom border of the table, as in step 3.*
Run the file by using the python main.py command.*
The output should be like this:
My code is following :
“”" This file will take a number from user input and print out multiplication table from 1 to 10 “”"
number = int(input())
print("Generate a multiplication table for: ", number)
for i in range(1,11):
It runs fine and outputs the list as it’s required in the task.
Can anyone help?