How to omitt newlines in Phython?
Question: I know..... one way to omitting new lines in Python with concatenation:

    
    
    a = 'strin'  
    b = 2  
    print str(b)+a  
    

how many ways we can this be done?


Answer: I believe, you are using Python2.x. You can try following:

  1. use a trailing comma.
    
         print a, # no new line will be printed
    

  2. use print function from future
    
        from __future__ import print_function
    print(a,end='') # no new line will be printed
    

And for Python3.x following will do. `Do not need to import print function`

    
    
         print(a,end='')
    

