TypeError: unsupported operand type(s) for //: 'str' and 'int'

3.1k views Asked by At

Why am I getting the error TypeError: unsupported operand type(s) for //: 'str' and 'int' in my code? enter image description here

I was expecting it to print whole hours rented, but it came up with an error.

1

There are 1 answers

0
Rushikesh Ghayal On

It's an error we get when we try to add or do operations on incompatible or different data types. For example:

Integer, String

To avoid the error, either use STR() to convert to String from Integer str(<Intiger Object>) or INT() for String to Integer. Like Int(<String Object>).