You should be able to use the format method:

"Location: {0:20} Revision {1}".format(Location, Revision)

You will have to figure out the format length for each line depending on the length of the label. The User line will need a wider format width than the Location or District lines.

Answer from IronMensan on Stack Overflow
🌐
Python
peps.python.org › pep-0008
PEP 8 – Style Guide for Python Code | peps.python.org
When the code needs to remain compatible with older versions of Python that don’t support the feature recommended by the style guide. Use 4 spaces per indentation level.
🌐
Reddit
reddit.com › r/learnpython › newbie here: blank spaces for better code readability?
r/learnpython on Reddit: Newbie here: blank spaces for better code readability?
January 11, 2022 -

Hi everyone!

I'm totally new to programming and just started learning python. As I don't want to get into the habit of wrongly formatted code I'll rather ask this question as google overwhelmed me with tons of stufff that was already way advanced. Is there any downside using spaces in your code? For example writing:

x = 1
if x < 2 :
    print("small")
elif x < 10 :
    print ("medium")
else :
    print ("large")
print ("All done!")

Instead of writing:

x=1
if x<2:
    print("small")
elif x<10:
    print("medium")
else:
    print("large")
print("All done!")

Thanks!

Discussions

PEP indentation using 4 spaces vs. Google's 2 spaces
I personally think 2 spaces is nearly unreadable. It isn't going to affect performance in any way. Don't adopt this. -Mek More on reddit.com
🌐 r/learnpython
24
24
February 9, 2014
How to make output have spaces between words?
You could simply add a space in the quotes, like “hello “ But in the long term, for this and other formatting concerns, you’ll want to learn about f-strings More on reddit.com
🌐 r/learnpython
10
9
July 13, 2023
Python: using 4 spaces for indentation. Why? - Stack Overflow
While coding python I'm using only 2 spaces to indent, sure PEP-8 really recommend to have 4 spaces, but historically for me it's unusual. So, can anyone convince me to use 4 spaces instead of 2? ... More on stackoverflow.com
🌐 stackoverflow.com
Spacing in python - Stack Overflow
Lets say I have the following variables: cheques = 1 x = 2 numberOfBACS = 87 and so on. Now in this case it's very simply to see the variables, but add in equations etc... and this section of cod... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Codingdeeply
codingdeeply.com › home › how to add space between lines in python? do this!
How to Add Space Between Lines in Python? Do This! - Codingdeeply
February 23, 2024 - In the next section, we’ll explore different methods for adding space between lines in Python, including the “\n” character, the “end” parameter, and the “os.linesep” function.
🌐
Stanford CS
cs.stanford.edu › people › nick › py › python-style-basics.html
Python Style Basics - PEP8 - Stanford Computer Science
Indent code by 4 spaces. A def/if/for/while line ends with a colon, and its contained lines beginning on the next line should all be indented 4 spaces, like this: ... Early on with Python, some people use 2 spaces or tabs.
🌐
Dummies
dummies.com › article › technology › programming-web-design › coding › styling-and-spacing-in-python-144280
Styling and Spacing in Python | dummies
March 26, 2016 - Generally, four spaces from the left margin is considered the style norm. See Python style suggestions on indentation, whitespaces, and commenting.
Author:
🌐
C2
wiki.c2.com
Python White Space Discussion
This site uses features not available in older browsers
Find elsewhere
🌐
Bu
cs-people.bu.edu › azs › fe459 › coding_standards.html
Python Coding Conventions and Standards — FE459, Boston University
January 9, 2026 - This is not ideal — if you aren’t using Spyder, you should configure your editor to use spaces. While the horizontal position of code on a line (i.e., indentation) conveys important information to the Python interpreter, the interpreter ignores the vertical spacing of code in a file.
🌐
W3Schools
w3schools.com › python › gloss_python_indentation.asp
Python Indentation
Python will give you an error if you skip the indentation: ... The number of spaces is up to you as a programmer, but it has to be at least one.
🌐
Reddit
reddit.com › r/learnpython › pep indentation using 4 spaces vs. google's 2 spaces
r/learnpython on Reddit: PEP indentation using 4 spaces vs. Google's 2 spaces
February 9, 2014 -

I'm currently reading the Python introduction by google, and I'm intrigued as to why the standard spacing is recommended to be 4 but google uses 2:

A common question beginners ask is, "How many spaces should I indent?" According to the official Python style guidelines (PEP 8), you should indent with 4 spaces. (Fun fact: Google's internal style guideline dictates indenting by 2 spaces!)

Why would their internal style guideline recommend a standard of two spaces instead of the normal 4? Is it related to how using * and + are "overload" operators as the introduction says? Would a py script that uses 2 spaces instead of 4 run quicker, or am I on the wrong hunch?

In the code comment, we hinted that * works faster than +, the reason being that * calculates the size of the resulting object once whereas with +, that calculation is made each time + is called. Both + and * are called "overloaded" operators because they mean different things for numbers vs. for strings (and other data types).

https://developers.google.com/edu/python/introduction

🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-print-spaces-in-python3
How to print spaces in Python3? - GeeksforGeeks
August 1, 2020 - Example 2: Printing spaces between two values while printing in a single print statement. ... # Python program to print spaces x = 1 y = 2 # use of "," symbol print("x:",x) print("y:",y) print(x,"+",y,"=",x+y)
🌐
Quora
quora.com › How-do-I-give-space-between-two-lines-in-Python
How to give space between two lines in Python - Quora
Answer (1 of 3): To give space between two lines in Python, you can use the newline character “\n”. This character is used to create a line break in a string, and it will cause any text following it to be displayed on a new line. if you use this more than on time it will create blank line ...
🌐
Replit
replit.com › home › discover › how to print a space in python
How to print a space in Python | Replit
The + operator is a straightforward way to join—or concatenate—strings. When you combine variables like first_name and last_name, you must also explicitly add a space string (" ") between them to ensure proper spacing in the final output. This is a fundamental technique in concatenating strings in Python.
🌐
GeeksforGeeks
geeksforgeeks.org › python › fill-a-python-string-with-spaces
Fill a Python String with Spaces - GeeksforGeeks
July 23, 2025 - Where, space is the space given to the left, right, or around the string + length of the string.
🌐
Team Treehouse
teamtreehouse.com › community › for-spacing-in-python
for spacing in Python (Example) | Treehouse Community
October 24, 2016 - Hi there! It depends entirely on where the space is. But yes, when using a method such as .format()it may not have a space between the string and the invocation of the method. If your space is inside a string, it won't matter. And yes, you will find that capitalization, punctuation, and spacing are very important in programming languages.
🌐
Python.org
discuss.python.org › python help
Indentation is important - Python Help - Discussions on Python.org
October 9, 2022 - I am just now learning about indentation in python. How do I know what needs indentation and by how much? This is confusing to me. I use Geany as my editor. Can it be setup to help me? You have to use the same number of spaces in the same block of code, otherwise Python will give you an error: Example Syntax Error: if 5 > 2: print("Five is greater than two!") print("Five is greater than two!")