I am a noob so this question maybe a crap for you.
As written in title, I want to stop print()
from printing space while using ,
.
I have code for that :
i = 1
print (i,"2")
Output = 1 2
Expected Output = 12
I am a noob so this question maybe a crap for you.
As written in title, I want to stop print()
from printing space while using ,
.
I have code for that :
i = 1
print (i,"2")
Output = 1 2
Expected Output = 12
Try this:
i = 1
print(i,"2",sep='')
or by use of str.format()
:
i = 1
print("{}2".format(i))
This may not be a good practise, but it certainly gets the job done:
print(i+"2")
Also as a note you should have i = "1"
as it should be a string.