String Formatting
Multiple Choice Easy
Question
Which is the modern way to format strings in Python?
Hint
f-strings are Python 3.6+.
Explanation
f-strings (f"...") are the modern way to format strings in Python 3.6+. Example: name = "Ada"; print(f"Hello {name}"). They are faster and more readable than % formatting or .format(). You can include expressions: f"{2 + 3}" gives "5". For multi-line, use triple-quoted f-strings.
Related Resources
Related Lessons
- Strings
Learn Python strings.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.