Python Variables

Click to rate this post!
[Total: 0 Average: 0]

Python Variables are nothing but the reserved memory locations to store the values. In other words, it is the name of the memory location where the data is stored. And if once the variable is stored a separate space is allocated in the memory.  Moreover, we can define the variable name using the combination of letters, number, and underscore.

Click the here to know the programming structure of python

Assigning values to the variables :

In fact, there is no explicit declaration to store the memory. And we can easily define a variable using the ‘=’operator.

Example :

a = 20

b = 30

print a



 Beside python online training suggest another type of declaring the variables.

Example :

a,b,c = 2,10,python

Note :

Python interpreter automatically identifies the types of variables

Can we re-declare a variable?

Today many starters have this question?   Hope you got the answer after reading this. And the answer to the question is yes, we can re declare a variable. But the Variable stores the most recent value.

Ex :

x  = ‘10’




Output :




These are fixed values that cannot be altered.

Ex : pi= 22.7

Gravity =9.8

Place these values separate files like

Now we can execute this by the following command

Import constant



So after running this command, we would get the following output

Output :



Willing to get certified on it Courses? Visit OnlineITGuru for Online Certification Courses

So till we seen the variable types, declarations. Now,  its time to discuss tokens

to our newsletter

Drop Us A Query

Trending Courses
  • Microsoft Azure Architect Technologies(AZ-300) | ITGuru
    Microsoft Azure Architect Technologies(AZ-300)
  • Azure is a great Microsoft Cloud Computing platform in providing various cloud services through online. ITGuru Certified Azure Architect certification course gives you the practical knowledge on Azure Cloud platform through real-world use cases from live experts

  • ServiceNow Admin Training | ITGuru
    ServiceNow Admin Training
  • Getting knowledge of cloud platforms like ServiceNow is essential in today’s world for the smooth running of projects in cloud platform. Turn your dream to the reality of becoming the Certified ServiceNow Administrator through ServiceNow Administration online certification Course with practical examples by live industry experts through online at ITGuru with real-world use cases.

  • Workday Financials Training | ITGuru
    Workday Financials Training
  • knowing the basics on any platform like Workday is not enough to sustain the IT industry. Hence it is essential to go beyond on Workday basics like Workday Financials training which lets you know the application of Financials management in real -world use cases from ITGuru Live Experts in a practical way.

  • Workday Training
  • An organization is considered as the best one when it offers the best benefits to the employee. Moreover, the greater the employee benefits, the greater the contribution to the organization. ITGuru let you know the practical workday Human Resource Management(HRM) features with live examples by experts

  • Python Online Course | ITGuru
    Python Online Course
  • Turn your dream into reality by ITGuru live experts with real-world use cases through practical knowledge on python online course and become the certified associate in python programming and become a master in python programming

  • Python Programming | ITGuru
    Python Programming
  • Python is the trending programming language in the IT industry. Mastering in python programming gives you more value among the people in the IT industry. Hence start today to learn python programming online by live experts with real-time uses cases at ITGuru

100% Secure Payments. All major credit & debit cards accepted.

Call Now Button