print()
Show values on the screen. Several values are separated by a space unless you change sep.
Syntax
print(value1, value2, sep=' ', end='\n')
- Strings go in quotes. Numbers and variables do not.
Example
print("Hello", "Pip")
print("a", "b", sep="-")Output:
Hello Pip a-b
Common mistakes
- print is all lower case: Print() is a NameError.
- A missing closing quote or bracket is the most common beginner error.