Skip to main content

Accepted Answer · #21 · 2026-04-25

Which answer is correct?

Difficulty 1/3

How to play

Read the Stack Overflow–style question, then pick the one correct answer from four plausible options. Watch out — wrong answers often have high fake votes.

What's the best way to format strings in Python?

I need to insert variables into a string. I've seen %, .format(), and f-strings. Which should I use?

pythonstringsformatting

Loading your progress...

Press 1 through 4, or tap a numbered choice, to answer. Back to hub