8/28/26Less than 1 minuteAbout 120 words
Concept: print()
The print() function is used to display output to the console. It can take multiple arguments, which will be printed with a space in between by default. You can also customize the separator and end character.
sep: Specifies the string that will be used to separate the arguments. Default is a space.end: Specifies the string that will be printed at the end of the output. Default is a newline character.
print("Connecting to server...", end=" ")
print("Success!")
# Output: Connecting to server... Success!
print("Server01", "192.168.1.10", "Online", sep=" | ")
# Output: Server01 | 192.168.1.10 | OnlineOutput can be further customized using escape characters:
| Escape Character | Description |
|---|---|
\n | New line |
\t | Tab |
\\ | Backslash |