Index
Introduction
The print function has some parameters that let you interact with the output of the function
End Parameters
The end parameter decide witch character goes at the end of the print
By default Python‘s print() function ends with a newline
But it can be changed with every string or Python Escaping Sequences
Sep Parameters
The step parameter decide witch character separates 2 o more objects, by default its a space symbol (” ”)
but it can be change with every string or Python Escaping Sequences
File parameter
In Python, you can print objects to the file by specifying the file parameter.
By default is set as sys.stdout
which prints objects on the screen
But it can be change with every file thats open in writing mode
file content:
--------------------------
1
2
3
--------------------------
This program in particular tries to open python.txt, but if it doesn’t exist in the directory that you are working in it will be created
oss: every time you open the file in this way all the text inside the file will be cleared
Read Python Files to learn more