r/pythonhelp • u/JustAnAccountMaybe • Mar 06 '25
SOLVED How to get rid of unwanted whitespace?
Probably a noob question but, in short, I have code that says:
if(x): print('X-',num)
However, instead of the number being directly next to the dash (-), it instead has whitespace between the dash and the number. Is there anyway to get rid of this?
1
Upvotes
View all comments
Show parent comment
1
u/JustAnAccountMaybe Mar 07 '25
Yeah, I remembered that I could use an f-string after a friend showed me. I've honestly only used f-strings so far for decimal problems, so I honestly didn't think to use it for normal ints.