Coerção de tipos (converter um tipo em outro)

This commit is contained in:
Luiz Otávio
2022-10-24 14:32:01 -03:00
parent ae16ef23dd
commit 33b1753ea8

9
aula6.py Normal file
View File

@@ -0,0 +1,9 @@
# conversão de tipos, coerção
# type convertion, typecasting, coercion
# é o ato de converter um tipo em outro
# tipos imutáveis e primitivos:
# str, int, float, bool
print(int('1'), type(int('1')))
print(type(float('1') + 1))
print(bool(' '))
print(str(11) + 'b')