Зміст курсу
Introduction to Data Analysis in Python
Introduction to Data Analysis in Python
If/elif/else
elif
is used if the previous condition is not met, but the current one is.
price = 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