By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,923 Members | 1,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,923 IT Pros & Developers. It's quick & easy.

how to remove space

P: 3
hey i've only just started using python so i'm not to good at it but how do you remove the spaces in a print out like this

col = b
row = 2
print 'the position is',col,row,'.'
the position is b 2 .
#those spaces between the b the 2 and the .
Mar 29 '08 #1
Share this Question
Share on Google+
1 Reply


bvdet
Expert Mod 2.5K+
P: 2,851
hey i've only just started using python so i'm not to good at it but how do you remove the spaces in a print out like this

col = b
row = 2
print 'the position is',col,row,'.'
the position is b 2 .
#those spaces between the b the 2 and the .
Expand|Select|Wrap|Line Numbers
  1. >>> col = 'b'
  2. >>> row = 2
  3. >>> print 'the position is %s%s.' % (col,row)
  4. the position is b2.
  5. >>> 
Mar 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.