Python - Conditional Statements
Find the error in this ternary expression:
result = "Pass" if score > 50 else "Fail" else "Invalid"
result = "Pass" if score > 50 else "Fail" else "Invalid"
else keywords, which is invalid syntax in Python ternary expressions.else part; multiple else cause SyntaxError.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions