Output with print()
print() displays values. Give it several values separated by commas and it puts a space between them. Use sep to change the separator and end to change what comes at the end (the default is a new line).
Example
print("Hello", "world")
print("a", "b", "c", sep="-")
print("no new line", end=" ")
print("same line")
print(10 + 5)Result
Hello world a-b-c no new line same line 15
Exercise
Change the separator to a dash.
print("x", "y", ="-")
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.