Python Numbers in Hindi

Python me 3 tarah ke numeric types hote hain:
(1) Int
(2) Float
(3) Complex

Aur python ke case me numeric types waise hi create hote hain jaise hi hum kisi variable me koi value assign karte hain.

Example :
a = 5    # int
b = 3.14  # float
c = 4 + 5j  # complex

Int Type

Int matlab integer, jo ek whole number hota hai aur jiski length unlimited hoti hai. Iski value positive ya Negative kuch bhi ho sakti hai.

Example :
a = 9
b = 58877116222554
c = –32555

print(type(a))
print(type(b))
print(type(c))

Float Type

Float jisko Floating Point Number bolte hain aur jiski value Positive/Negative kuch bhi ho sakti hai lekin har ek number me 1 decimal point jarur hona chahiye.

Example :
a,b,c = 2.53, 3.0, -45.5
print(type(a))
print(type(b))
print(type(c))

Complex Type

Complex Type means jo complex values ko signify karta hai, aisi value jisme real aur imaginary part dono hote hain. For example 5 +2j

Example :
a = 5+2j
print(type(a))

Data Types ka aapas me Type Conversion

Example :
a = 3    # int
b = 4.85  # float
c = 4+3j   # complex

#int se float me conversion:
x = float(a)


#float se int me conversion:
y = int(b)


#int se complex me conversion:
z = complex(c)

print(type(a))
print(type(x))
print(type(b))
print(type(y))
print(type(c))
print(type(z))