[Solved] How can I convert the -pay , hour ,and rate-to int [duplicate]


You can cast it on input like this:

hrs = int(input("Enter Hours:"))

However, there is no need to do this as the compiler can tell which data type has been input.

Example:

>>> hrs = input("Enter Hours:")
Enter Hours:30
>>> type(hrs)
<type 'int'>

You can see that python already knows what type has been entered. Instead of trying to cast the input, you may be better checking the data type which has been inputted to verify it is an integer.

solved How can I convert the -pay , hour ,and rate-to int [duplicate]