Menu
CoddyTech

Recap: Eligibility Rules

Lesson 11 of 48 in Coddy's Python for GDScript Developers course.

challenge icon

Challenge

Beginner

Read a display name, an age token, and a credit token on three lines. Age is missing or an integer from 0 to 120; credit is missing or an integer from -20 to 20. The scaffold parses optional values. Print the name, using Guest when empty. Then print one decision, with this priority: incomplete if either numeric value is absent; underage if age is below 18; debt if credit is negative; otherwise eligible. Zero credit is valid.

Print only these lines, ending each with a newline. Keep the supplied input scaffold; it reads the stated values without prompts.

Your code goes in main.py. The locked driver.py starts your program and cannot be edited.

Try it yourself

# Starts the program in main.py. Edit main.py to solve the challenge.
from runpy import run_module

run_module("main", run_name="__main__")

All lessons in Python for GDScript Developers

Practice on your own: Online Python compiler