Shortest solution

Just add a comma after the unpacked list.

>>> a = [1, 2, 3]
>>> print(f"Unpacked list: {*a,}")
Unpacked list: (1, 2, 3)

There is a longer explanation to this syntax in this thread.

Caveat

With this solution is that we do not have much control over the output formatting. We are stuck with whatever format returns, which is actually (and suprisingly) the result from tuple.__repr__. So the parenthesis that we get might be misleading, since we actually had a list, and not a tuple.

If this is too bad to put up with, I would recommend using the approach suggested by Zero Piraeus:

>>> a = [1, 2, 3]
>>> print(f'Unpacked list: {" ".join(str(i) for i in a)}')

This gives us the flexibility to format the list as we wish.

Answer from SenhorLucas on Stack Overflow
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ using f-string's with a list
r/learnpython on Reddit: using f-string's with a list
May 3, 2023 -

just thought id make a post incase anyone has an issue using f-string with a list. i moved on from using .format() to using f-string. i have found it pretty easy to get adjusted to but i was struggling with using specific values within a list, i treid a few methods like:

names = ['Adam', 'Bob', 'Cyril']
text = f'Winners are: {0} {1} {2}'(*names)
print(text)

names = ['Adam', 'Bob', 'Cyril']
text = f'Winners are: {*0} {*1} {*2}'(names)
print(text)

names = ['Adam', 'Bob', 'Cyril']
text = f'Winners are: {[0]} {[1]} {[2]}'(names)
print(text)

all came back with errors and left me stuck on how to use f-string with a list until i watched Corey Schafers video, within the half an hour i was pretty much trying to brute force it, reaching the same error, i found out the correct way of interlopoing a list with a f-string is:

names = ['Adam', 'Bob', 'Cyril']
text = f'Winners are: {names[0]}, {names[1]}, {names[2]}'
print(text)

just thought id make the post incase anyone else is unsure on how.

๐ŸŒ
Real Python
realpython.com โ€บ python-f-strings
Python's F-String for String Interpolation and Formatting โ€“ Real Python
November 30, 2024 - Python runs the method call and inserts the uppercased name into the resulting string. In the second example, you create an f-string that embeds a list comprehension.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ formatted-string-literals-f-strings-python
f-strings in Python - GeeksforGeeks
June 19, 2024 - We use curly braces to use a variable value inside f-strings, so we define a variable 'val' with 'Geeks' and use this inside as seen in the code below 'val' with 'Geeks'. Similarly, we use the 'name' and the variable inside a second print statement. ... # Python3 program introducing f-string val = 'Geeks' print(f"{val}for{val} is a portal for {val}.") name = 'Om' age = 22 print(f"Hello, My name is {name} and I'm {age} years old.")
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ python-f-string
Python f-string: A Complete Guide | DataCamp
December 3, 2024 - F-strings are string literals prefixed with 'f' or 'F' that contain expressions inside curly braces {}. These expressions are evaluated at runtime and then formatted using the __format__ protocol. Unlike traditional string formatting methods, f-strings provide a more straightforward and readable ...
๐ŸŒ
Bentley
cissandbox.bentley.edu โ€บ sandbox โ€บ wp-content โ€บ uploads โ€บ 2022-02-10-Documentation-on-f-strings-Updated.pdf pdf
A Guide to Formatting with f-strings in Python - CIS Sandbox
There are several ways to align variables in f-strings. The various alignment options are as ... Forces the expression within the curly braces to be left-aligned. This is the ... Forces the expression within the curly braces to be right-aligned.
Find elsewhere
๐ŸŒ
ZetCode
zetcode.com โ€บ python โ€บ fstring
Python f-string - formatting strings in Python with f-string
May 11, 2025 - F-strings allow you to dynamically set the width and precision of your formatted output by using variables instead of hardcoded values. This provides great flexibility when you need to adjust formatting based on runtime conditions or user preferences. ... #!/usr/bin/python value = 123.456789 ...
๐ŸŒ
Linux Hint
linuxhint.com โ€บ use-new-f-strings-in-python
Linux Hint โ€“ Linux Hint
Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ formatted-strings
Python Formatted Strings / f-string formatting Guide
To create an f-string, prefix the string with the letter f and place variables or expressions inside curly braces {} directly in the string. ... Become a Python developer.
๐ŸŒ
DZone
dzone.com โ€บ coding โ€บ languages โ€บ efficient string formatting with python f-strings
Efficient String Formatting With Python f-Strings
January 2, 2024 - f-string simplifies string formatting, which provides a concise and readable way to embed expressions inside string literals.
๐ŸŒ
datagy
datagy.io โ€บ home โ€บ python posts โ€บ python f-strings: everything you need to know!
Python f-strings: Everything you need to know! โ€ข datagy
December 20, 2022 - Learn how to use Python f-strings including using conditions, formatting values, aligning values, and debugging. A video tutorial is included!
๐ŸŒ
Python Morsels
pythonmorsels.com โ€บ string-formatting
Python f-string tips & cheat sheets - Python Morsels
April 12, 2022 - It's nifty that we can customize the format of strings and numbers within an f-string. But what about other types? What else supports format specifiers? Python's datetime.datetime class (along with datetime.date and datetime.time) supports string formatting which uses the same syntax as the strftime method on these objects.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ python-f-strings-tutorial-how-to-use-f-strings-for-string-formatting
Python f-String Tutorial โ€“ String Formatting in Python Explained with Code Examples
September 14, 2021 - When you're formatting strings in Python, you're probably used to using the format() method. But in Python 3.6 and later, you can use f-Strings instead. f-Strings, also called formatted string literals, have a more succinct syntax and can be super h...
๐ŸŒ
Python Tutorial
pythontutorial.net โ€บ home โ€บ python basics โ€บ python f-strings
Python F-strings: a Practical Guide to F-strings in Python
March 30, 2025 - Note that you need to prefix the string with the letter f to indicate that it is an f-string. Itโ€™s also valid if you use the letter in uppercase (F). Third, print out the string s. Itโ€™s important to note that Python evaluates the variables and expressions in f-string at runtime.
๐ŸŒ
Hostman
hostman.com โ€บ tutorials โ€บ how-to-use-f-strings-in-python
Master Python f-Strings: Formatting Strings with Examples
Title: Python f-strings Description: f-strings are powerful, fast, and easy to use. F-strings can contain other f-strings or be combined with traditional strings. This capability is helpful for dynamic and complex outputs. ... With f-strings, you can directly access elements from lists or keys in dictionaries.