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')
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 4
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Suggested prompts:
Mi faccia domande su questo argomento
Riassuma questo capitolo
Mostri esempi dal mondo reale
Awesome!
Completion rate improved to 2.7
If/elif/else
Scorri per mostrare il menu
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')
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 4