Data types:-
Data type represent the type of data present inside a variable.
There are 14 types of data types present in python.
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link] developing Desktop application.
[Link] developing web app.
[Link] developing database app.
[Link] Network programming.
[Link] developing games.
[Link] Data analysis application and data science.
[Link] machine learning.
[Link] AI(Artificial Inteligence) app.
[Link] IOT(Internet of things)
Limitation of python.
How to check a variable which data type is holding?
ans:- type()
Int(integer)
we can use int data type to represent whole number(integral value)
>>> a=10
>>> type(a)
<class 'int'>
how can we convert int as other format?
[Link] form(float)
[Link] form
[Link] form
[Link] decimal form
[Link] form(float)(base-10)
It is the default number system in python
the allowed digits are : 0 to 9
ex:- a= 10
float(a)
10.0
[Link] form(base-2)
the allowed digits are : 0 and 1
Literal value should be prefixed with 0b or 0B.
use bin()
>>> a = 10
>>> bin(a)
'0b1010'
>>>
[Link] 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'
[Link] Decimal Form(Base - 16)
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