seed: curriculum content
This commit is contained in:
44
1.solar-system/2.first-light/09.the-temperature/index.md
Normal file
44
1.solar-system/2.first-light/09.the-temperature/index.md
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
type: challenge
|
||||
title: "The Temperature"
|
||||
xp: 75
|
||||
duration: 30
|
||||
difficulty: 2
|
||||
---
|
||||
|
||||
# The Temperature
|
||||
|
||||
> **[INCOMING — Mission Control, Earth]**
|
||||
>
|
||||
> Cadet, half the world reads temperature in Fahrenheit, the other
|
||||
> half in Celsius. Build a converter.
|
||||
>
|
||||
> Formula: `C = (F - 32) * 5 / 9`
|
||||
>
|
||||
> Implement `f_to_c(f)` that returns a string of the form:
|
||||
>
|
||||
> ```
|
||||
> <F>°F = <C>°C
|
||||
> ```
|
||||
>
|
||||
> Where `<C>` is rounded to one decimal place using `:.1f`. Convert
|
||||
> the input with `float()` first so the output is consistent for
|
||||
> int and float inputs.
|
||||
>
|
||||
> Examples:
|
||||
>
|
||||
> - `f_to_c(32)` → `"32.0°F = 0.0°C"`
|
||||
> - `f_to_c(212)` → `"212.0°F = 100.0°C"`
|
||||
> - `f_to_c(98.6)` → `"98.6°F = 37.0°C"`
|
||||
>
|
||||
> [END TRANSMISSION]
|
||||
|
||||
## Your Task
|
||||
|
||||
In `starter/starter.py`, convert `f` to float, compute Celsius,
|
||||
return the formatted string.
|
||||
|
||||
## Objectives
|
||||
|
||||
- All three examples produce the exact expected string
|
||||
- Works for any numeric F input
|
||||
Reference in New Issue
Block a user