Multiplication Table using Python program



              Hello, In this blog we see the Python code to print multiplication table. In this program user give the input and depends on that integer number the multiplication table will displayed.

Code:
num = int(input("Display multiplication table of? "))
for i in range(1, 11):
   print(num, 'x', i, '=', num*i)

In the above code we use the range function. So easily we compact the code as compare to c, c++, java. In last print line all the operations are taken in one line and the output is displayed to the user.
Output:

Display multiplication table of? 12
12 x 1 = 12
12 x 2 = 24
12 x 3 = 36
12 x 4 = 48
12 x 5 = 60
12 x 6 = 72
12 x 7 = 84
12 x 8 = 96
12 x 9 = 108
12 x 10 = 120


Multiplication Table using Python program Multiplication Table using Python program Reviewed by Amit Waghmare on January 04, 2020 Rating: 5

3 comments:

  1. Wow, This is very amazing blog and its a lot of learn, thanks for sharing us.
    https://sisayed360.blogspot.com

    ReplyDelete
  2. As claimed by Stanford Medical, It's really the one and ONLY reason this country's women live 10 years longer and weigh on average 42 lbs lighter than us.

    (And actually, it really has NOTHING to do with genetics or some hard exercise and really, EVERYTHING related to "how" they are eating.)

    P.S, What I said is "HOW", not "WHAT"...

    TAP on this link to discover if this brief questionnaire can help you decipher your true weight loss possibility

    ReplyDelete
  3. Thanks for sharing your
    knowledge realted to programming

    ReplyDelete