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:
-
The variable
report_is_incorrect
equalsFalse
– this means either the report was not rejected, or some other check passed. -
The variable
report_is_ready
equalsTrue
– this means the report was approved and not flagged as invalid.
Рішення
9
1
2
3
4
5
6
7
8
# 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
9
1
2
3
4
5
6
7
8
# 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)
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат