Learn Python Basics In 5 Minutes

Python needs no introduction. In the world of programming language, python is emerging as a rock star, a super-hero. But why is Python so popular? To understand this, you must know programming language is a medium to achieve the desired result. Now if something can be done easily, quickly with python, you will not go for any other language.

In Google there is a saying :

Python Where We Can , C++ where We Must.

But the best part of python is its easiness. Let’s learn the basics of python, so you can start your journey.

Install Python

You can install python from python.org.


Once you have installed python, you need an editor to write codes and execute your programs. There are various editors to choose from. But we are going to go with PyCharm.

Install PyCharm

You can install PyCharm from its official site.


Click on Black Download Button to download the Community version of PyCharm, It is free and you will not have to pay any charge.

Once you have downloaded Python and PyCharm, You are ready to go.

How To Write Your First Program

Click On PyCharm that you have just downloaded, A pop-up window will appear.

Now that you know how to run PyCharm, Let’s dive into the basics of Python.

Data Types

Python offers a lot of data types such as :

  • integer (int)
  • float (float)
  • string (str)
  • boolean (bool)
  • list (list)
  • sets (set)
  • tuples (tuple)
  • dictionary (dict)

We will cover these data types ahead in this article.


You do not need to declare variables before using them or declare their type.

age = 25

Here age is a variable that is assigned a value 25. So the data type of age is an integer.

How to Print in Python

We use a simple function print, to print anything on the console screen.


Before anything let’s go through each data type one by one.

integer (int) :

Any number positive or negative with no decimal value is integer data type.


To convert any a value to an integer data type we use int() function


float (float) :

Any number positive or negative with a decimal value is a float data type.


To convert any a value to float data type we use float() function


string (str) :

String is a collection of characters written underquotes.

‘medium’, ’python’, ’123’

To convert any value to string data type we use the str() function.


boolean (bool) :

Data that is either True or False.

True , False

To convert any a value to boolean data type we use the bool() function


lists (list) :

List is a collection of values of different data types enclosed within square brackets [].


Sets (set) :

Set is a collection of unique values of different data types enclosed within curly brackets {}.


Tuples (tuple) :

Tuple is a collection of values of different data types that cannot be changed enclosed within curly brackets ().


Dictionary (dict) :

Dictionary is a collection of key : value pair enclosed within curly brackets {}.

{‘name’ : ‘Console Flare’ , ‘city’ : ‘ Noida ’}

User Input

To take input from user, we use input() function in python. Let’s do a simple program to understand use of input.

name = input(‘Enter Your Name : ’)

company = input(‘Where do you work ? ’)

print(‘I am’ , name, ’and I work in’ , company)


input() function always takes input from user in string data type, so we need to convert values from user to desired data type to perform the operation.

length = int(input(‘Enter Length : ’))

breadth = int(input(‘Enter Breadth : ’))

print(‘Area is ’, length * breadth)



Loops are used to perform repetitive action.

for i in range(3):



Functions are piece of code that does a particular task. To define a function in Python, we use def keyword.

def funcname(parameters):


For example , let’s say we want to create a function to add two numbers:

def add(x,y):


Calling a Function



How To Learn Python The Right Way?

Now that you have learned basics of python, Let’s know more about python.

When you are learning a programming language, your goal must be clear.

Why do you want to learn this programming language ? What you will be doing after you master this language ? You must find a reason to learn this language. Every language has one application that surpasses other.

Python , now a days , is used for Data Science. Data Science , not to tell, is a booming field. You can go through this article to know salary trends for Data Scientists in India.

If you want to put your python knowledge to best use, Apply it in Data Science. To learn Data Science, you can connect to us.

We are Console Flare. We have successfully placed more than 1000 students and IT Graduates to become Data Scientist.

We also provide webinars for you to join and know more about Data Science.

You can connect to us at ConsoleFlare and Become a Data Scientist in just 5 Months.

2 thoughts on “Learn Python Basics In 5 Minutes

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top