The tab is working properly, you probably are looking for .ljust(width)

lems = ['scaena', 'persona', 'improbus']
for i in lems:
    print('{}{}'.format(i.ljust(10), 'whatever'))

prints out:

scaena    whatever
persona   whatever
improbus  whatever

Sometimes it's useful to calculate the max length of your strings so the output is more reliable

lems = ['scaena', 'persona', 'improbus']
max_len = max(len(l) for l in lems)
for i in lems:
    print('{}{}'.format(i.ljust(max_len + 1), 'whatever'))
Answer from Gonzo on Stack Overflow
🌐
Medium
medium.com › python-basics-beyond › how-to-print-a-tab-in-python-a6c7df39c2ca
How to Print a Tab in Python. Learn different methods to print tab… | by A. S. M. Muhiminul Hasan | Python Basics & Beyond | Medium
December 3, 2024 - A text editor or Python IDE · The most common way to print a tab is using the \t escape sequence: # Print text with tabs print("Name\tAge\tCity") print("John\t25\tNew York") print("Alice\t30\tLondon") You can also use string formatting methods: # Using f-strings with tabs name = "Bob" age = 35 print(f"{name}\t{age}") # Using format() method print("{}\t{}".format(name…
🌐
Medium
medium.com › @NirantK › best-of-python3-6-f-strings-41f9154983e
Best of Python3.6 f-strings. f-strings (formatted strings) for those… | by Nirant Kasliwal | Medium
April 16, 2018 - Arranging the elements becomes a nightmare with several \t tab characters flying around. This is much easier with Python f-strings using the colon ‘:’ operator, followed by a an alignment operator and field width value.
🌐
Altcademy
altcademy.com › blog › what-is-f-in-python-2
What is f' in Python - Altcademy.com
January 29, 2024 - The \n inserts a newline, and the \t inserts a tab, resulting in: ... What if you want to include a quote inside your f-string? You can mix single and double quotes to achieve this. quote = f"Bob said, \"Python is fun!\"" print(quote)
🌐
Towards Data Science
towardsdatascience.com › home › data science › how to add new line in python f-strings
How to Add New Line in Python f-strings | Towards Data Science
June 15, 2021 - As we already discussed, backslashes cannot be used directly in Python f-strings. However, there is an easy workaround that allows us to include backslashes in order to denote for example new lines, tabs etc.
🌐
GeeksforGeeks
geeksforgeeks.org › string-alignment-in-python-f-string
String Alignment in Python f-string - GeeksforGeeks
March 22, 2025 - Explanation: The first print statement centers "Python" within 20 spaces, filling the empty space with -. The second line left-aligns "Python" within 15 spaces, filling the remaining space with *. The third line right-aligns "Python" within ...
Find elsewhere
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › formatted-string-literals-f-strings-python
f-strings in Python - GeeksforGeeks
June 19, 2024 - To create an f-string, prefix the string with the letter “ f ”. The string itself can be formatted in much the same way that you would with str.format(). F-strings provide a concise and convenient way to embed Python expressions inside string ...
🌐
sebhastian
sebhastian.com › python-print-tab-spaces
How to print a tab in Python | sebhastian
January 29, 2023 - If you put the tab character in a variable, you can use it in the f-string expression part like this: name = "Nathan" age = 29 tab = '\t' print(f"{name + tab + str(age)}") # ✅ · Personally, I prefer to put the \t escape sequence outside of ...
🌐
Yurok Language Project
linguistics.berkeley.edu › plab › guestwiki › index.php
Output formatting in Python - Phonlab
October 15, 2013 - The head line creates a tab-delimited set of field names. The fmt line creates a format string fmt that contains a list of keyword fields, v, idx, f1, f2. Each field is followed by : and a format specifier that tells Python how to interpolate values into the string.
🌐
ZetCode
zetcode.com › python › fstring
Python f-string - formatting strings in Python with f-string
May 11, 2025 - F-strings allow you to justify strings to the left, right, or center within a given width. This is controlled by the >, <, and ^ characters after the colon. Justification is useful for aligning text in tables or output. ... #!/usr/bin/python words = ['sky', 'fork', 'small', 'cup', 'car', 'war'] ...
🌐
Python.org
discuss.python.org › python help
Python add or insert tab (\t) into list - Python Help - Discussions on Python.org
June 8, 2023 - Hi All, I am new to python. I am trying to add a /t to a string variable and insert in to a list. when I print the string, it prints with tab space. When the same variable added to the list it prints \t. how to fix it. str1="new_service_group" src_grp="servicegroups\t\t\t\t"+str1 print("src_grp is = "+src_grp) array=['define service{', 'host_name host-a1p', 'service_description Disk Space /var', 'use ch_rating_system', '}'] array.insert(len(array)-1,src_...
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-print-a-tab-in-python-enhancing-text-formatting
How to Print a Tab in Python - GeeksforGeeks
December 26, 2024 - The print() function in Python accepts a 'sep' parameter in which specifies the separator between the multiple values passed to the function. By default 'sep' is set to the ' ' (space) but we can change it to '\t' to the insert tabs between the values. ... We can also print a tab by string concatenation that contains \t with other strings.
🌐
Miguendes
miguendes.me › 73-examples-to-help-you-master-pythons-f-strings
Python F-String: 73 Examples to Help You Master It
July 2, 2022 - PEP 498 presented this new string ... thing required is to put a 'f' before a string. And if you're new to the language, that's what f in Python means, it's a new syntax to create formatted strings....
🌐
W3Schools
w3schools.com › python › python_string_formatting.asp
Python String Formatting
Before Python 3.6 we had to use the format() method. ... F-string allows you to format selected parts of a string.
🌐
Bobby Hadz
bobbyhadz.com › blog › python-print-tab
How to print a Tab in Python | bobbyhadz
April 10, 2024 - Use the \t character to print a tab, e.g. print('bobby\thadz'). The \t character inside the string is the escape sequence for the tab character.
🌐
Reddit
reddit.com › r/learnpython › forcing indentation level in multiline f-strings
r/learnpython on Reddit: forcing indentation level in multiline f-strings
March 23, 2024 -

how do i force every line of a multiline replacement string variable to maintain the same indentation level as the variable to which it is assigned inside a large multline f-string
or in other words if i have a large f-string and inside it i have {}'s which are themselves attached to smaller multiline f-strings which are dynamically created how do i, in the larger string, force every line in each smaller string to maintain the same indentation level within the large string as the variable it is assigned to. not counting \t characters in the smaller f-strings
related question how do i unindent an f-string aka what is the character equivalent, if there is one, of shift-tab

🌐
Real Python
realpython.com › python-f-strings
Python's F-String for String Interpolation and Formatting – Real Python
November 30, 2024 - Python's f-strings provide a readable way to interpolate and format strings. They're readable, concise, and less prone to error than traditional string interpolation and formatting tools, such as the .format() method and the modulo operator ...