Python is a dynamically typed programming language which means there is no need to declare the data type of variable.
x=12 y="hello world" z=15.45 print(x) print(y) print(z) #PTHON OUTPUT 12 hello world 15.45
To check variable belongs to which data type use type() built-in method in python.
type()
x = 15 #<class 'int'> interger y = "Hello Python" #<class 'str'> string z = 21.20 #<class 'float'> float a = True #<class 'bool'> boolean #print all Variables print(x, y, z, a) #print datatype of Variables print(type(x), type(y), type(z), type(a)) #python output <class 'int'> <class 'str'> <class 'float'> <class 'bool'>
In python, operators are used to combining, do mathematical calculation or logical conditioning.
a = 10 b = 5 c = 10+5 print(c) #python output 15
The article was taken from the code learners website
Awesome! :D!
Understanding variables in Python
Python is a dynamically typed programming language which means there is no need to declare the data type of variable.
Example
To check variable belongs to which data type use
type()
built-in method in python.Example
Combine Variables
In python, operators are used to combining, do mathematical calculation or logical conditioning.
Example
The article was taken from the code learners website
Awesome!
:D!