level == 3 is for checking if the level variable has the value 3, I guess what you want is level = 3 to affect the value 3 to level.
To perform several actions on a single line of code, you have to use ;, not ,.
I would suggest you to split your if statements into several lines, instead of trying to fit everything on one single line. Your code would be easier to read and to debug. See 4. More Control Flow Tools — Python 3.12.1 documentation for examples.