Secrets Of The Print Function You Didn't Know #coding #python #programming

preview_player
Показать описание
the parameters of print()
Рекомендации по теме
Комментарии
Автор

This is perfect for CSV formating; In the backend, writing to a document and writing to the console is the same thing, it's just a different data stream. This is why the file and flush arguments exist. The file argument is actually any object that support writing string to them, and flush forces the elements that are in the ram to be written to the stream; wether that's the console, a file or an object that you've created, that's up to the "file" argument.
Actually , if you want to, you could make a class that is able to be used as the file argument in the print function. Make it such that that it writes something like this :

Line 1 : "Hello world !"
Line 2 : "FooBar"

rndargis
Автор

If you set the end to something different, the next print prints after the first print. Not below

Rickachu_uwu
visit shbcf.ru