Python end parameter in print()
print() function in python prints a new line in the end by default. Sometimes we might don't want this behaviour, we may want to print nothing, or an space or maybe some other character. For things like this, we have end parameter in python.
end parameter in python print() function is used to specify the end character to be printed after the given string has been printed.
Have a look at examples.
# ends the output with a <space>
print("Hello" , end = ' ')
print("World", end = ' ')
#Outputs Hello World
print("Hello" , end = '_')
print("World")
#Outputs Hello_World
If we don't specify any end parameter with print() function, then by default, it's a new line character i.e '\n'.
print("Hello")
print("World")
Outputs
Hello
World