Can 'sep' be an empty string?

QuestionsQuestions8 SkillsProPython Control StructuresNov, 17 2025
092

Yes, the sep parameter can be set to an empty string (''). When you do this, the printed arguments will be concatenated together without any space or separator between them.

Example

Here's an example of using sep as an empty string:

print("Hello", "World", "from", "Labby", sep='')

This will output:

HelloWorldfromLabby

In this case, all the words are printed together without any spaces or separators.

Summary

  • Setting sep='' will concatenate the printed arguments directly next to each other.
  • This can be useful when you want to format output without any spaces or additional characters.

If you have more questions or need further clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!