Explain type-conversion in python?

: 800
Paper : Python FAQ (Frequently Asked Questions and answers) for freshers | Platform : Object-oriented programming Language | Category : Programming FAQs

Before jumping into how type-conversion is done first, we must be familiar with what is type-conversion. Type-conversion means converting a variable from one data type to another data type. The functions that are used in the conversion is:

  • int(): It converts any data type into the integer type.
  • float(): It converts any data type into the float type.
  • ord(): It converts characters into the integer. 
  • hex(): It converts integer data type into the hexadecimal type.
  • oct(): It converts the integer data type to the octal type.