Pregunta de entrevista de Syntronic

Pointless question like fixing the code below by changing the order only: state will be "not connected" or "connected" if "connected" in state: raise TestPassed("") else: raise TestFailed("")

Respuesta de la entrevista

Anónimo

6 abr 2025

The correct answer is : if state in "connected": raise TestPassed("") else: raise TestFailed("") Yup, I know normal person would write the code like if state == "connected" rather than this