0

As is known to all, when we want to suppress a new line caused by a print, in python2, we do:

 print 'abc',  
 print 'def'  

while in python3, we do:

 print('abc',end='')  
 print('def')  

However, an extra space will be created at the end of the string in python2 version above. Do you know how to suppress the extra space in the python2 version to achieve the exactly same result as in python3?

Kobi K
  • 7,743
  • 6
  • 42
  • 86
booksee
  • 389
  • 1
  • 3
  • 16

0 Answers0