How to print spaces in Python?
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Following are the examples demonstrating how to print the spaces in Python?
Example 1: A simple way to print spaces
The simple way is to give the space between the message wherever we need to print space in the output.
Output
Example 2: Printing spaces between two values while printing in a single print statement
When we print multiple values separated by the commands using the print statement – Python default print a between them.
Output
Example 3: Give multiple spaces between two values
To give multiple spaces between two values, we can assign space in a variable, and using the variable by multiplying the value with the required spaces. For example, there is a variable space assigned with space and we need to print 5 spaces - we can use space*5 and it will print the 5 spaces.
Output
need an explanation for this answer? contact us directly to get an explanation for this answer