Data Types Conversion in Python (Casting)

🎓 Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will help you Learn Python from A to Z!

🖥️ Conversion between Data Types in Python (Casting)

In Python, Data Types are used to classify one particular type of data, determining the values that you can assign to this type, and the operations you can perform on it.

Nonetheless, there are few times you may need to convert values between types, in order to manipulate these values in a different way. For example, you may need to concatenate numeric values with strings, or represent decimal places in numbers that were initialized as integer values.

As you have seen along the previous examples, you can get the data type of any object, by using the type() function. And the isinstance() function, to check whether an object belongs to a particular class.

You also have multiple constructors, for each one of the data types in Python. You can simply use these constructors to use the specified data type. Or, you can change a data type to another one using these Python constructors.

Basically, type casting is the process of changing one data type into another type. Using these constructors, you can use various data types with the functionality of the other.

○ list()
○ set()
○ tuple()
○ dict()
○ str()
○ int()
○ float()
○ bool()
○ complex()

Suppose you declare the list mentioned in the example as a tuple in a program. It will become immutable for that particular operation. Similarly, we can use other constructors, as well!

Let’s play this video, stick around and watch until the end of this video! 👍🏻

– Digital Academy™ 🎓

***

☞ WATCH NEXT:
○ Data Types in Python – https://youtu.be/cweUByxBWiU
○ Operators in Python – https://youtu.be/-wDaVLkKOiU
○ IF Statements in Python – https://youtu.be/CC5seZ6OBJ4
○ FOR Loops in Python – https://youtu.be/JgH-D5DSTho

☞ WATCH MORE:
○ HOW TO Learn Python? Python Tutorial for Beginners [FULL Course] https://youtu.be/9hvnSZPMtuw

📖 Blog: http://digital.academy.free.fr/blog/

📖 Complete Python Development Course for Beginners [PLAYLIST]: http://digital.academy.free.fr/playlist/python-development-for-beginners

#Python #Tutorial #Beginners #Shorts

***

♡ Thanks for watching and supporting ♡
Please Subscribe. Hit the notification bell.
Like, Comment and Share.

***

♡ FOLLOW US ♡
http://digital.academy.free.fr/
https://twitter.com/DigitalAcademyy
https://www.facebook.com/digitalacademyfr
https://www.instagram.com/digital_academy_fr/
https://www.youtube.com/c/DigitalAcademyOnline

♡ SUPPORT US ♡
http://digital.academy.free.fr/donate
http://digital.academy.free.fr/subscribe
https://www.patreon.com/digital_academy

***

Copy link
Powered by Social Snap