LoslegenKostenlos loslegen

and, or, not (1)

A boolean is either 1 or 0, True or False. With boolean operators such as and, or and not, you can combine these booleans to perform more advanced queries on your data.

In the sample code, two variables are defined: my_kitchen and your_kitchen, representing areas.

Diese Übung ist Teil des Kurses

Intermediate Python

Kurs anzeigen

Anleitung zur Übung

  • Write Python expressions, wrapped in a print() function, to check whether:
    • my_kitchen is bigger than 10 and smaller than 18.
    • my_kitchen is smaller than 14 or bigger than 17.
    • double the area of my_kitchen is smaller than triple the area of your_kitchen.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Define variables
my_kitchen = 18.0
your_kitchen = 14.0

# my_kitchen bigger than 10 and smaller than 18?


# my_kitchen smaller than 14 or bigger than 17?


# Double my_kitchen smaller than triple your_kitchen?
Code bearbeiten und ausführen