Challenge: The Not Statement
Aufgabe
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.
Lösung
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)
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 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)
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen