WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Python Numbers


Number data type is store values.


Python Number types:

type Description
int(signed integers) integers are whole number it is positive and negative but without decimals.
float (floating point real values) called floating point number it is positive and negative may be decimals
complex (complex numbers) if a+bK where a and b are float but K represent square root
K are imaginary

Int

Example


x = 1
y = 1,738,000
z = -1738

print(type(x))
print(type(y))
print(type(z)) 

Result
C:\Users\My Name>python demo_numbers_int.py


 

Float

Example

x = 1
y = 1.2
z = -1738

print(type(x))
print(type(y))
print(type(z)) 

Complex

Example

x = 58e2
y = 16E8
z = -1738.7e100

print(type(x))
print(type(y))
print(type(z))