Learnmonkey Learnmonkey Logo
× Warning:

The tutorial you are reading is currently a work in-progress.

Python Casting

What is Casting?

Let's imagine that we were building a command line application and we wanted the user to enter a number and we wanted to do some arithmetic with it. We can't do arithmetic with strings, so we have to convert our string into an integer. We would use casting to accomplish that.