print()
Writes values to the screen (or a file), separated by sep and ended by end.
Beginner
print("V =", 3.3, "volts") # V = 3.3 volts
print(1, 2, 3, sep=", ") # 1, 2, 3
print("no newline", end="")
print("to a file", file=open("log.txt", "a"))
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.