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

Publicado em: 30 Dezembro 2022
no canal de: 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))


Nesta página do site você pode assistir ao vídeo on-line Python Numbers. Python code with example. Python Complete Course Video # 6 duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Guangshu Coder 30 Dezembro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 38 vezes e gostou like espectadores. Boa visualização!