" Implementing User Input and Comments in a Script " Unable to finish task

Hi there

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)

print("____________________")

for i in range(1,11):

print(i,":",number*i,)

print("____________________")

It runs fine and outputs the list as it’s required in the task.

Can anyone help?

Anyone?

I am stuck, unable to resolve

Hey Levani!

Sorry for the late response. The issue here is that your number variable is asking for an input without prompting the user.

Combining the first two lines of your code to number = int(input('Generate a multiplication table for: ')) will pass the check!

Best,
Lorraine