- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Data Type Conversion in Python
Sometimes, you may need to perform conversions between the built-in types. To convert between types, you simply use the type name as a function.
There are several built-in functions to perform conversion from one data type to another. These functions return a new object representing the converted value.
|Sr.No.||Function & Description|
Converts x to an integer. base specifies the base if x is a string.
|2||long(x [,base] )|
Converts x to a long integer. base specifies the base if x is a string.
Converts x to a floating-point number.
Creates a complex number.
Converts object x to a string representation.
Converts object x to an expression string.
Evaluates a string and returns an object.
Converts s to a tuple.
Converts s to a list.
Converts s to a set.
Creates a dictionary. d must be a sequence of (key,value) tuples.
Converts s to a frozen set.
Converts an integer to a character.
Converts an integer to a Unicode character.
Converts a single character to its integer value.
Converts an integer to a hexadecimal string.
Converts an integer to an octal string.
- Type Conversion in Python
- Type Conversion in C++
- What are different data conversion methods in Python?
- What is Type Conversion?
- Difference Between Type casting and Type Conversion
- Number Data Type in Python
- String Data Type in Python
- List Data Type in Python
- Tuple Data Type in Python
- Dictionary Data Type in Python
- What is Type conversion in C#?
- What is type conversion in java?
- Catch block and type conversion in C++
- Data Conversion Using valueOf() In Java.
- What is the difference between type conversion and type casting in C#?