Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Виклик: Робота з Операторами Порівняння | Умовні Оператори
Вступ до Python

book
Виклик: Робота з Операторами Порівняння

Завдання

Swipe to start coding

Вам надано змінні first, second та third. Використовуючи оператори порівняння, перевірте наступне:

  • Чи має first таке ж значення, як і third? Збережіть результат у змінній first_comparison.
  • Чи є добуток first * second меншим за добуток third * first? Збережіть результат у змінній second_comparison.

Рішення

first = -5
second = 10
third = -50

# Write your code here
first_comparison = first == third
second_comparison = first * second < third * first

# Testing
print("The result of the first comparison:", first_comparison)
print("The result of the second comparison:", second_comparison)
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 2
first = -5
second = 10
third = -50

# Write your code here
first_comparison = ___
second_comparison = ___

# Testing
print("The result of the first comparison:", first_comparison)
print("The result of the second comparison:", second_comparison)
toggle bottom row
some-alt