spam ['eggs'print(xyzend='')print(xyzspam ['eggs']spam ['eggs'print(xyzend=\ 'spam ['eggs'suppress line break two printssame output line custom line end you can also combine keyword arguments to specify both separators and end-of-line strings--they may appear in any order but must appear after all the objects being printedprint(xyzsep='end='!\ 'spam ['eggs']print(xyzend='!\ 'sep='spam ['eggs']multiple keywords order doesn' matter here is how the file keyword argument is used--it directs the printed text to an open output file or other compatible object for the duration of the single print (this is really form of stream redirectiona topic we will revisit later in this section)print(xyzsep='file=open('data txt'' ')print(xyzspam ['eggs'print(open('data txt'read()spam ['eggs'print to file back to stdout display file text finallykeep in mind that the separator and end-of-line options provided by print operations are just conveniences if you need to display more specific formattingdon' print this way insteadbuild up more complex string ahead of time or within the print itself using the string tools we met in and print the string all at oncetext '% % % ('result' print(textresult print('% % % ('result' )result as we'll see in the next sectionalmost everything we've just seen about the print function also applies directly to print statements--which makes sensegiven that the function was intended to both emulate and improve upon printing support the python print statement as mentioned earlierprinting in python uses statement with unique and specific syntaxrather than built-in function in practicethough printing is mostly variation on themewith the exception of separator strings (which are supported in but not xand flushes on prints (available as of only)everything we can do with the print function has direct translation to the print statement print operations