how to remove space

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oursmokeingjoe
    New Member
    • Mar 2008
    • 3

    #1

    how to remove space

    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 .
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Originally posted by oursmokeingjoe
    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 .
    [code=Python]
    >>> col = 'b'
    >>> row = 2
    >>> print 'the position is %s%s.' % (col,row)
    the position is b2.
    >>> [/code]

    Comment

    Working...