Command Palette

Search for a command to run...

Hectal
Phase 1: Values, Variables and Types
Python · Exercise 4 of 6 PreviousNext
Beginner

Can they enter?

A hall lets a person in if they are at least 18 and they either have a ticket or are a member.

Set can_enter to True or False using the variables age, has_ticket and is_member (do not type True or False yourself). Then the last line prints Can enter: True for these values.

What Check tests

  1. can_enter is True
  2. can_enter is a real bool
  3. The program uses and and or
  4. The program prints Can enter: True

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

main.py
Sign in to run your code.

Output

Press Run to see what your program prints.