Python Tutorials
- Python
- How to install Python?
- PIP
- How to Run Python Program
- Python Identifiers,Statement, Indentation and Comments
- Variable
- Data type
- Decision Making
- Python Loops
- Break,Continue, Pass
- Functions
- Predefine Functions
- Lambda Functions
- Variable Scope
- List
- Tuple
- Python Sets
- Python Dictionary
- Python String
- String Formating
- Input/Output
- File Handling (Input / Output)
- Iterators
- Python Modules
- Python Date
- Python JSON
- Classes and Objects
- Constructor
- Polymorphism
- Encapsulation
- inheritance
- Class or Static Variables in Python
- class method vs static method
- Abstraction
- Exception Handling
- MySql Python
- MySql Create Database
- MySql CRUD
- Django
Python Variables?
A variable is a named location used to store data in the memory.
Variable is a user define name that is used to refer to memory location. Python variable is also known as an identifier and used to hold value.
Python variables do not need explicit declaration to reserve memory space. The declaration happens automatically when you assign a value to a variable.
The operand to the left of the = operator is the name of the variable and the operand to the right of the = operator is the value stored in the variable.you should always use lowercase letters for the variable name. Sana and sana both are two different variables.
File name : index.php
number = 10
website = "ittutorial.in"
print(website)
variable declaration
File name : index.py
name = "Sana Mahtab"
father_name = "Mahtab Habib"
age = "2"
print("My name is: ", name, )
print("My Father name is: ", father_name, )
print("My age is: ", age)
Multiple Assignment
File name : index.php
a = b = c = 1
a,b,c = 1,2,"john"
Python Float initialize :-
File name : index.php
x = 20.85669842
y = -0.0000000008566945
print(x)
print(y)
Object References
Python is the highly object-oriented programming language; that's why every data item belongs to a specific type of class.
print("Arham Kalam")
The Python object creates an integer object and displays it to the console. In the above print statement, we have created a string object.
type("Kashaf Kalam") function
Output: