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.
- Default setting:
- ‘Hello’ and ‘World’ are being printed.
- Output: Hello World
- Utilize the sep parameter:
- Output “HelloWorld”.
- Output: Hello, World.
By setting sep=” will result in printing multiple values without any delimiter, achieving output without spaces.