0Pricing
Python Academy · Lesson

String Formatting with f-strings

Use f-strings and format() for clean, readable output.

Introduction

F-strings (f'...') are Python's modern string interpolation syntax — fast, readable, and powerful.

Basic f-string

Prefix a string with f and put expressions in {}. f'Hello {name}' inserts the value of name inline.
name = 'Alice'
print(f'Hello {name}!')

All lessons in this course

  1. String Basics and Indexing
  2. String Slicing and Concatenation
  3. Common String Methods
  4. String Formatting with f-strings
← Back to Python Academy