Else and elif statements | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Else and elif statements

Every time I use the else: and elif: statements my code doesnā€™t run and it shows me an error stating ā€˜invalid syntaxā€™. Why is it so?

21st Mar 2018, 7:29 AM
Goku
2 Respostas
+ 3
Seeing the code helps, but you might be leaving it incomplete, like: if 1 == 2: print(ā€œuniverse brokeā€) else: The code above has syntax error indeed, try writing: # ... else: pass
21st Mar 2018, 3:20 PM
Pedro Demingos
Pedro Demingos - avatar
+ 4
please, post your code here
21st Mar 2018, 8:34 AM
šŸ“ˆSmileGoodHopešŸ“ˆ
šŸ“ˆSmileGoodHopešŸ“ˆ - avatar