Conversões em Python usam int(), float() e str(). Para códigos de caracteres, use ord() e chr().
Exemplo de códigoPython
number_text = "50.5"
# If we tried to add number_text + 10, we would get a type mismatch error
actual_number = float(number_text) + 10
print("The calculation worked: ", actual_number)
Exemplo de códigoPython
ascii_code = ord("A")
print("The numeric code of letter A is: ", ascii_code) # 65
# If we add 1 to the code and convert back, we move forward in the alphabet!
print("The next letter in the alphabet is: ", chr(ascii_code + 1))