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')
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 4
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Suggested prompts:
Запитайте мені питання про цей предмет
Сумаризуйте цей розділ
Покажіть реальні приклади
Awesome!
Completion rate improved to 2.7
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')
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 4