seed: curriculum content
This commit is contained in:
40
1.solar-system/2.first-light/07.the-prompt/index.md
Normal file
40
1.solar-system/2.first-light/07.the-prompt/index.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
type: challenge
|
||||
title: "The Prompt"
|
||||
xp: 50
|
||||
duration: 25
|
||||
difficulty: 2
|
||||
---
|
||||
|
||||
# The Prompt
|
||||
|
||||
> **[INCOMING — Mission Control, Earth]**
|
||||
>
|
||||
> Cadet, every program takes input. In this stage, your functions
|
||||
> receive input as *parameters* — values passed in by whoever called
|
||||
> you.
|
||||
>
|
||||
> *f-strings* (formatted strings) embed values directly into text:
|
||||
>
|
||||
> ```python
|
||||
> name = "Vega"
|
||||
> f"Hello, {name}!" # → "Hello, Vega!"
|
||||
> ```
|
||||
>
|
||||
> Implement `welcome(name, planet)` that returns:
|
||||
>
|
||||
> ```
|
||||
> Welcome, <name> from <planet>.
|
||||
> ```
|
||||
>
|
||||
> [END TRANSMISSION]
|
||||
|
||||
## Your Task
|
||||
|
||||
Open `starter/starter.py`. Use an f-string to return the welcome
|
||||
message.
|
||||
|
||||
## Objectives
|
||||
|
||||
- `welcome("Vega", "Mars")` → `"Welcome, Vega from Mars."`
|
||||
- Works for any name and planet
|
||||
Reference in New Issue
Block a user