+ 1

šŸ‡­šŸ‡³ Cuantos espacios se debe dar al indentado vean el sig. Cidigo

1 num = 7 2 if num == 5: 3 print("number is 5") 4 else:: 5 if num == 11: 6 print("num is 11") 7 else: 8 if num == 7: 9 print("number is 7") 10 else: 11 print("number isn ' 15, 11 or 1") Al cambiar los espacios del indentado de lineas 7 y 8 la salida tura error, entonces los dejo la 7 a cuatro y el if de la ocho la i la colici justo debajo de lis dos puntos del else linea 7, pregunta por que se da este.errir?

2nd Nov 2017, 7:11 PM
Oscar Herculano
Oscar Herculano - avatar
3 Answers
+ 3
maybe two :: on line 4
2nd Nov 2017, 7:12 PM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 3
Lot of issues really, from the line 4 error that Abdur mentioned to the indentation of most things. https://code.sololearn.com/cR3Sqlzcn03X/#py ^Corrected your code. Python is really annoying with what you do in regard to whitespaces, so be cautious of that annoyance. num = 12 if num == 5: print("number is 5") else: if num == 11: print("num is 11") else: if num == 7: print("number is 7") else: print("number isn't 5, 11 or 7")
2nd Nov 2017, 7:30 PM
AgentSmith
+ 1
Gracias, Netkos
4th Nov 2017, 5:25 PM
Oscar Herculano
Oscar Herculano - avatar