← Python from Scratch
Lesson 15 of 78 · 5 XP
Warm-up: f-string warm-up
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
An f-string is a string with the letter f before the quotes. Inside it you can write variables in curly braces {} — Python puts in their values:
name = "Ann"
print(f"Hello, {name}!") # Hello, Ann!
Task. Read a name and an age (each on its own line) and print them on one line like this:
Name: Ann, age: 12
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.