DEV Community

loading...

Discussion on: Python Zero to Hero #Beginners⚡

Collapse
hanpari profile image
Pavel Morava

There is no type casting in Python since it is unnecessary in dynamically typed language.

What you showed is conversion between types.

There is casting in the typing module, but this is far beyond the beginner level.

In your exception handling, you may want to add block finally, which is essential for recovering from IO errors.

Collapse
vivekcodes profile image
vivek patel Author • Edited

Thanks! i feel it ❤casting is not necessary in python but when i learned python from different sources they added one same topic python casting so that's why i added casting here! python is so smart that it will automatically detect data types we don't need to specify ! Yes i left many topics like finally,pass,raise,class,continue,lambda,from,assert,del,global,not,with,async,or,yield and more but i would also like to add that i didn't miss any important topic for beginners🙂❤

Collapse
hanpari profile image
Pavel Morava • Edited

OK, I checked it and it seems I was wrong. Casting is the right term here, even for Python. However, I would prefer to call it the type conversion.

Sorry about that :)

Thread Thread
vivekcodes profile image