Skip to content
dreamcode
dreamcode
Projects
Sky House
Guided projectPython
Reward: +200 XP
PROJECT BRIEF

Sky House

The Sky House needs a doorbell that knows its guests. Write build_greeter(names): it takes a list of names and returns a list of greetings, one per name, in the same order.

Each greeting must read exactly Hello, NAME! Welcome to the Sky House. with the name in place of NAME. Guests sometimes type extra spaces around their name, so trim them first. An empty guest list gives an empty list back.

Build it step by step
  1. Loop over names with a for loop.
  2. Trim each name with .strip().
  3. Build the sentence with an f-string and append it to greetings.
  4. Return the finished list.
Examples
build_greeter(['Nova', 'Luka'])
['Hello, Nova! Welcome to the Sky House.', 'Hello, Luka! Welcome to the Sky House.']
build_greeter([])
[]
project.py
PYTHON
Saved as you type

Tests

0 of 4 passing
  • two guests
    build_greeter(['Nova', 'Luka'])
    expected ['Hello, Nova! Welcome to the Sky House.', 'Hello, Luka! Welcome to the Sky House.']
  • nobody home
    build_greeter([])
    expected []
  • one guest
    build_greeter(['Dreamer'])
    expected ['Hello, Dreamer! Welcome to the Sky House.']
  • names with stray spaces
    build_greeter([' Ada ', 'Grace'])
    expected ['Hello, Ada! Welcome to the Sky House.', 'Hello, Grace! Welcome to the Sky House.']
On the line
+200 XP
Pass all 4 tests to claim it.