DEV Community

Guna Ramesh
Guna Ramesh

Posted on

What is Sep-Seperate in Python?

sep **stands for separator
**sep
works only when there are 2 or more values.
Its cant work if any one value is available.

print("Gunalan", sep="*")
output
Gunalan
Enter fullscreen mode Exit fullscreen mode

If you didn't use **sep **to make a **space **By default Python uses space, so we use sep to change it.

program
print("Gunalan","Ramesh")
output
Gunalan Ramesh
Enter fullscreen mode Exit fullscreen mode

So we need any thing instead of Space use sep for change.
Example:

program
print("Gunalan","Ramesh",sep="*")
output
Gunalan*Ramesh
print("Gunalan","Ramesh",sep=".")
output
Gunalan.Ramesh
print("Gunalan","Ramesh",sep="with")
output
GunalanwithRamesh
But you did \n 
output
Gunalan
Ramesh
Enter fullscreen mode Exit fullscreen mode

Reason is \n is used for push next value to next line.
Symbol Meaning
\n next line
\t tab space
\ backslash
\' single quote
\" double quote
They are special commands inside .

Top comments (0)