Python Print Without Spaces: Using sep Parameter

When using the print function to output multiple values, by default, it will separate them with a space. If you don’t want to include a space, you can customize the separator using the sep parameter.

  1. Default setting:
  2. ‘Hello’ and ‘World’ are being printed.
  3. Output: Hello World
  4. Utilize the sep parameter:
  5. Output “HelloWorld”.
  6. Output: Hello, World.

By setting sep=” will result in printing multiple values without any delimiter, achieving output without spaces.

bannerAds