Python Numbers. Python code with example. Python Complete Course Video # 6

Veröffentlicht am: 30 Dezember 2022
auf dem Kanal: Guangshu Coder
38
like

Python Numbers
There are three numeric types in Python:
int
float
complex
Variables of numeric types are created when you assign a value to them:
x = 1 # int
y = 2.8 # float
z = 1j # complex
Int, or integer, is a whole number, positive or negative, without decimals, of unlimited length.
Float, or "floating point number" is a number, positive or negative, containing one or more decimals.
Complex numbers are written with a "j" as the imaginary part
.#coding #programming #python #pythonprogramming #pythontutorial
python numbers
x = 1
y= 72.3
z = 7j
print(type(x))
print(type(y))
print(type(z))

int
x = 1
y = 2343435345345
z = -2343243
print(type(x))
print(type(y))
print(type(z))

float
x = 1.22
y = 2.0
z = -232.22
print(type(x))
print(type(y))
print(type(z))

float can also be scientific number with an "e" to indicate power
x = 34e4
y = 12E3
z = -3434e7
print(type(x))
print(type(y))
print(type(z))

complex
x = 3+8j
y = 5j
z = -9j
print(type(x))
print(type(y))
print(type(z))


Auf dieser Seite können Sie das Online-Video Python Numbers. Python code with example. Python Complete Course Video # 6 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Guangshu Coder 30 Dezember 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 38 Mal angesehen und es wurde von like den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!