Wednesday, 22 September 2021

Python: end parameter usage in print method

‘print’ method is used to send the objects to the text stream file. By default it send the data to the console.

 

Signature

print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)

 

‘end’ parameter is used to specify the end string after writing the given data to the test stream file.

 

print_demo_2.py

print('little', end='->')
print('johney', end=',')
print('play', end='@')

Output

little->johney,play@


 

Previous                                                    Next                                                    Home

No comments:

Post a Comment