Variables in Python

Variables are containers for storing data values.


Creating Variables

Python has no command for declaring a variable.

Example

x = 5

y = "john"

print(x)

print(y)

Output-

5

john


A variable is created the moment you first assign a value to it.

Variables are used for store data on memory location. In python no need to declare variable explicitly, when you assign value to varibale that variable declared automatically.

TrueFalseand
assetdefNone
asclassfrom
continuebreakfinally
globalelifdel
forifelse
exceptimportraise
passreturnor
nonlocaltryin
lambdaisnot


Program:

  #!/usr/bin/python3

counter = 100          # An integer assignment
miles   = 1000.0       # A floating point
name    = "John"       # A string

print (counter)
print (miles)
print (name)
Here, 100, 1000.0 and "John" are the values assigned to counter, miles, and name variables, respectively. This produces the following result −

Output:

100 1000.0 john

Do you Know?
Progamming is what actually means ?

What is software development ?

How we categorized software development in different manner.

C Programming
C Plus Plus
Python
Java Development
Web Designing
Javascript
Mysql
Oracle
We cover all the programming concepts in various programming languages, this tutorials are very help full for bigener as well as Experience developer, for the ease of understanding we categorized programming in different manner likewise.