write string how written python code example
Example 1: python write to file
with open(filename,"w") as f:
f.write('Hello World')
Example 2: how to print a string in python
print("Insert your message here.")
with open(filename,"w") as f:
f.write('Hello World')
print("Insert your message here.")