Sitemap
Pendurvenu

Pendurvenu

Type Conversion In Python

2 min readAug 17, 2026

The converion of data from one type to another type is called type conversion

there are two types of conversions are there:-

  1. Implicit type conversion
  2. Explicit type conversion

=>Implicit type conversion:- whenever the conversion is done by the python engine automatically based on the importance of given data.

but the python engine converts the data from one type to another with out losing any given information then it will perform the action.

python engine first gives importance to complex,float & int.

examples:-

=>Explicit type conversion:-when ever the conversion is forcefully done by the programmer from one data type to another then this type conversion is called explicit type conversion.

In this explicit type conversion while performing action by the programmer whether it may lose date or may be not.

Get Pendurvenu’s stories in your inbox

Join Medium for free to get updates from this writer.

in this explicit type conversion there is a tool called constructor.

  1. int ( )

In this int constructor the int will construct any given int and float value to int only

example:-

2.float ( )

In this float constructor the float will construct any given int and float value to float only.

example:-

3.complex ( )

In this complex constructor the complex will construct any given value int,float and complex to complex data type.

example:-

--

--