Answers for "can you print to multiple output files python"

1

can you print to multiple output files python

# Python 3
print('Python', 3, 'Rocks', end=' ')
print('I love Python')
>>> Python 3 Rocks I love Python
Posted by: Guest on August-19-2020
1

can you print to multiple output files python

# Python 3
outputFile1 = open('text.txt', 'w')
outputFile2 = open('text2.txt'. 'w')

print('Hello World', file=outputFile1)
print('Hello World 2', file=outputFile2)
Posted by: Guest on August-19-2020

Code answers related to "can you print to multiple output files python"

Python Answers by Framework

Browse Popular Code Answers by Language