If/else Statements
Decision making is required when we want to execute a code only if a certain condition is satisfied.
The if, elif, else statement is used in Python for decision making.
123456price = 999 if price > 1000: print('The price is high. I won't buy it') else: print('OK, I will buy it')
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 2
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Suggested prompts:
Запитайте мені питання про цей предмет
Сумаризуйте цей розділ
Покажіть реальні приклади
Чудово!
Completion показник покращився до 2.7
If/else Statements
Свайпніть щоб показати меню
Decision making is required when we want to execute a code only if a certain condition is satisfied.
The if, elif, else statement is used in Python for decision making.
123456price = 999 if price > 1000: print('The price is high. I won't buy it') else: print('OK, I will buy it')
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 2