Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: The Not Statement | Істина чи брехня?
Типи даних у Python

book
Challenge: The Not Statement

Завдання

Swipe to start coding

Sometimes in accounting, we need to check if something is not true — for example, if a report was not approved or not rejected. Let's practice that!

Replace ___ with either True or False so that:

  1. The variable report_is_incorrect equals False – this means either the report was not rejected, or some other check passed.

  2. The variable report_is_ready equals True – this means the report was approved and not flagged as invalid.

Рішення

# This should be `False`: the report is not rejected, and the other condition is also false
report_is_incorrect = not True or False

# This should be `True`: the report is approved, and not marked as invalid
report_is_ready = True and not False

print("Variable report_is_incorrect equals:", report_is_incorrect)
print("Variable report_is_ready equals:", report_is_ready)
Все було зрозуміло?

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

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

Секція 2. Розділ 5
# This should be `False`: the report is not rejected, and the other condition is also false
report_is_incorrect = not True or ___

# This should be `True`: the report is approved, and not marked as invalid
report_is_ready = ___ and not False

print("Variable report_is_incorrect equals:", report_is_incorrect)
print("Variable report_is_ready equals:", report_is_ready)

Запитати АІ

expand
ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt