Answers for "how to add space in python"

0

add space before and after string python

using re adds white-space before and after the desired characters:

import re

pat = re.compile(r"([.()!])")
print (pat.sub(" \\1 ", string))
# hello .  .  .   ( world )  !
Posted by: Guest on March-20-2021
0

how to add space in python

x = 10
y = x * 0.62
z = y * 2.14

print(str(x) + " " + str(y) + " " + str(z))
Posted by: Guest on October-22-2021

Code answers related to "how to add space in python"

Python Answers by Framework

Browse Popular Code Answers by Language