poem = '''There was a young lady named Bright,
Whose speed was far faster than light;
She set out one day
In a relative way
And returned on the previous night.
'''

print( len(poem) )

fout = open('relativity_1', 'wt')

# write by file object
print( fout.write(poem) )
fout.close()

fout = open('relativity_2', 'wt')

# write by print function
print( poem, file = fout , sep ='', end ='')
fout.close()

poem = '''There was a young lady named Bright,
Whose speed was far faster than light;
She set out one day
In a relative way
And returned on the previous night.
'''

print( len(poem) )

fout = open('relativity_1', 'wt')

# write by file object
print( fout.write(poem) )
fout.close()

fout = open('relativity_2', 'wt')

# write by print function
print( poem, file = fout , sep ='', end ='')
fout.close()

There was a young lady named Bright, Whose speed was far faster than light; She set out one day In a relative way And returned on the previous night. # write by file object # write by print function