Answers for "how to remove white space when printing in python"

0

python remove white space

>>> '     hello world!    '.strip() #remove both
'hello world!'

>>> '     hello world!'.lstrip() #remove leading whitespace
'hello world!'
Posted by: Guest on November-23-2021
4

strip whitespace python

>>> s.strip()
'Hello  World   From Pankaj tnrtHi There'
Posted by: Guest on February-19-2020
0

how to strip white space of text in python?

sentence = ' hello  apple'
" ".join(sentence.split())
>>> 'hello apple'
Posted by: Guest on March-26-2021
-1

remove space in print python

age = 20
print("My age is ", age, '.', sep='')
Posted by: Guest on June-17-2021

Code answers related to "how to remove white space when printing in python"

Python Answers by Framework

Browse Popular Code Answers by Language