You’re correct and the ones who told you it was a syntax error, it isn’t. It is exactly the “mismatched data type” since the keys on the variable “rooms” are integers, but the user input or the variable “room” is specifically not an integer or a number. In other words, the user input returns a string and the “rooms” variable keys are integers which create a mismatched data type when matched together by an if statement and can probably cause confusion. To prevent this, make sure to see if both values that you’re gonna be comparing are the same data types.
solved What is the exact problem of this code in Python? [closed]