sep
The keyword parameter of print that sets the text placed between its arguments; by default a single space.
In more detail
print(a, b, sep="") prints the values with nothing between, and sep=", " puts a comma and space between them. It is written as a keyword argument after the positional ones.
Example
print("2", "3", sep="") # 23Related terms
- print() — The built-in function that writes values to the screen, separated by spaces and followed by a newline.
- end — The keyword parameter of print that sets what is printed after the last argument; by default a newline.
- keyword argument — An argument passed by naming the parameter it is for, as in print(x, end=""), instead of by position.
Taught in
- Input, And Numbers Versus Digits — Hands-on Python: Complete Video Course & Book
- The String Format Method — Hands-on Python: Complete Video Course & Book
- The Print Function Keyword End — Hands-on Python: Complete Video Course & Book
- Split And Join — Hands-on Python: Complete Video Course & Book
- Thirty Questions, One Sneaky Print — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Operators And Who Binds First — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Print, Input And The Casts Between — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Fundamentals Sprint — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep