If/elif/else
elif
is used if the previous condition is not met, but the current one is.
12345678price = 999 if price > 1000: print('The price is high. I won't buy it') elif price > 500: print('I will think if I need it') else: print('I will definitely buy it')
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 3. Capítulo 4
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Awesome!
Completion rate improved to 2.7
If/elif/else
Desliza para mostrar el menú
elif
is used if the previous condition is not met, but the current one is.
12345678price = 999 if price > 1000: print('The price is high. I won't buy it') elif price > 500: print('I will think if I need it') else: print('I will definitely buy it')
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 3. Capítulo 4