python - Remove whitespace in print function -



python - Remove whitespace in print function -

this question has reply here:

how print variables without spaces between values 4 answers

i have code

print "/*!",your_name.upper(),"*/";

where your_name info user inputs.

how can edit code above tell scheme remove whitespace?

update:

if print code, i'll /*! your_name */

i want remove whitspaces between /*! your_name */

the spaces inserted print statement when pass in multiple expressions separated commas. don't utilize commas, build one string, pass in 1 expression:

print "/*!" + your_name.upper() + "*/"

or utilize string formatting str.format():

print "/*!{0}*/".format(your_name.upper())

or older string formatting operation:

print "/*!%s*/" % your_name.upper()

or utilize print() function, setting separator empty string:

from __future__ import print_function print("/*!", your_name.upper(), "*/", sep='')

python

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -