“couler en python” Réponses codées

couler en python

x = int(1)   # x will be 1
y = int(2.8) # y will be 2
z = int("3") # z will be 3

x = float(1)     # x will be 1.0
y = float(2.8)   # y will be 2.8
z = float("3")   # z will be 3.0
w = float("4.2") # w will be 4.2

x = str("s1") # x will be 's1'
y = str(2)    # y will be '2'
z = str(3.0)  # z will be '3.0'
Asif Iqbal Paracha

couler en python

x = "3"
int(x)

y = "2.6"
float(y)

z = "1j"
complex(z)

print(typeof(x))
# Int
# float
# complex
The Cat Coder

Caste de type python

x = int(1.1)
y = str(1.1)
z = float(1.1)
print(x)
print(y)
print(z)
Javasper

Python Variable Type Casting

x = str("Jack");
y = int(111)
print(x)
print(y)
Javasper

Réponses similaires à “couler en python”

Questions similaires à “couler en python”

Plus de réponses similaires à “couler en python” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code