Class 5 Datatype Int
Class 5 Datatype Int
1.int
2.float
3.complex
4.bool
5.str
6.bytes
7.bytearray
8.range
9.list
10.tuple
11.set
12.frozenset
13.dictionary
14.None
1.For developing Desktop application.
2.For developing web app.
3.For developing database app.
4.For Network programming.
5.For developing games.
6.Fotr Data analysis application and data science.
7.For machine learning.
8.For AI(Artificial Inteligence) app.
9.Fot IOT(Internet of things)
Limitation of python.
How to check a variable which data type is holding?
ans:- type()
Int(integer)
>>> a=10
>>> type(a)
<class 'int'>
1.Decimal form(float)
2.Binary form
3.octal form
4.hexa decimal form
1.Decimal form(float)(base-10)
ex:- a= 10
float(a)
10.0
2.Binary form(base-2)
3.Octal Form(Base-8)
the allowed digits are : 0 to 7
Literal value should be prefixed with 0o or 0O.
use oct()
>>> a = 10
>>> b = oct(a)
>>> b
'0o12'
the allowed digits are : 0 to 9 and a to f(both are lower and upper)
Literal value should be prefixed with 0x or 0X.
use hex().
ex:-
>>> a = 10
>>> b = hex(a)
>>> b
'0xa