Joshua Swartz
Joshua Swartz

Reputation: 31

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

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.

Upvotes: 0

Views: 4875

Answers (1)

Rushikesh Ghayal
Rushikesh Ghayal

Reputation: 1

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>).

Upvotes: 0

Related Questions