๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Python Beginner

What is F-String?

A formatted string literal prefixed with f that allows embedding Python expressions directly inside curly braces.

F-strings (formatted string literals, PEP 498, Python 3.6+) provide a concise way to embed expressions in strings: f"Hello, {name}!". They support format specifications: f"{price:.2f}", expressions: f"{2+2}", and method calls: f"{name.upper()}".

F-strings are faster than .format() and % formatting, and are the recommended approach for string formatting in modern Python.

Related Terms

Generator
A function that yields values one at a time using the yield keyword, enabling memory-efficient iteration over large datasets.
Python Descriptors
Objects that define __get__, __set__, or __delete__ methods, controlling how attribute access works on other objects.
FastAPI
A modern, high-performance Python web framework for building APIs with automatic OpenAPI documentation and type validation.
Celery
A distributed task queue for Python that enables asynchronous processing of background jobs and scheduled tasks.
Python Iterator Protocol
The interface requiring __iter__() and __next__() methods, enabling objects to be used in for loops and other iteration contexts.
Asyncio
A Python library for writing concurrent code using async/await syntax for non-blocking I/O operations.
View All Python Terms โ†’