Python Projects 1: To display Table || For Absolute beginners

python project to display table

This is one of the easiest projects for beginners to get hands-on experience of python and start making some basic projects.

Description: Here we want to accomplish when a user enters any number, the table of that number must be displayed in IDE.

What you will learn ? – By completing this project ,as beginner you will get glimpse of –

  • How to take input from the user
  • How to use for loop in python

Let’s start……

Step 1 : Take Input from the user

number = input("Enter the number to print table:")

Step 2 : As we know ‘input’ always return a string therefore we need to first covert string to int

number = int(input("Enter the number to print table:"))

Step 3: Run the for loop to iterate variable.

for i in range(1,11):
	line = str(number)+"*"+str(i)+"="+str(number*i)    // 6*1=6

Step 4 : Now , the last is to print ‘line’

print(line)

Here’s the full source code

number = int(input("Enter the number to print table:"))

for i in range(1,11):
	line = str(number)+"*"+str(i)+"="+str(number*i)
	print(line)

Save file with filename.py and enter the file in a any IDE you like to run and type the command below

python filename.py

Congratulations, you had completed this awesome project .Well Done.

Solve Basic Python challenges on Dictionaries

Be the first to comment

Leave a Reply

Your email address will not be published.


*