Function Details: print
Description
Prints objects to the text stream file, separated by sep and followed by end.
Extended Description
The print() function writes the given object(s) to the text stream file (default is sys.stdout). All non-keyword arguments are converted to strings and written to the stream, separated by sep and followed by end. Both sep and end must be strings; they can also be None, which means to use the default values. If no objects are given, print() will just write end. The file argument must be an object with a write(string) method; if it is not present or None, sys.stdout will be used. The flush keyword argument, if true, forces the stream to be flushed.
Read More about print from Python Documentation
Function Signature
print(*objects: Any, sep: Optional[str] = ' ', end: Optional[str] = '\n', file: Optional[TextIO] = None, flush: bool = False) -> None
Module: builtins
Parameters
Parameter List
- *objects: Any
- sep: Optional[str]
- end: Optional[str]
- file: Optional[TextIO]
- flush: bool
Return
This function doesn't return a value; it prints to the specified output stream.
Return Type
None
Output
Explanation
These examples show basic usage of print() with different numbers and types of arguments.