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
  • Selenium with python
    Selenium with Python Training
  • As we know, that Selenium with Python Web Browser Selenium Automation is Gaining Popularity Day by Day. So many Frameworks and Tools Have arisen to get Services to Developers.

  • machine learning with python
    Machine Learning with Python Training
  • Over last few years, Big Data and analysis have come up, with Exponential and modified Direction of Business. That operate Python, emerged with a fast and strong Contender for going with Predictive Analysis.

  • Data science with R
    Data Science With R Training
  • Understanding and using Linear, non-linear regression Models and Classifying techniques for stats analysis. Hypothesis testing sample methods, to get business decisions.

  • data science with python
    Data Science with Python Training
  • Everyone starts Somewhere, first you learn basics of Every Scripting concept. Here you need complete Introduction to Data Science python libraries Concepts.

  • devops with azure
    Devops with Azure Training
  • As we Know Azure DevOps is a Bunch of Services, in guiding Developers. It contains CI/CD, pipelines, code Repositories, Visual Reporting Tools and more code management with version control.

  • python training
    Python Certification Training
  • Python is a dynamic interrupted language which is used in wide varieties of applications. It is very interactive object oriented and high-level programming language.

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

Call Now Button