How to remove ‘whitespace’ in the variable while ‘print’ing?

In Python3 the print function add a new line terminator at the end of each line. To avoid this we can use separator which works in the following way.

Its syntax is shown below.Seperator is used to suppress whitespace  in print

print (name, ",How are you?",sep='')

To delete end line terminator (e.g. n, r, s etc.)

print (name, ",How are you?",end='')

Leave a Reply

Your email address will not be published. Required fields are marked *