python write a method code example
Example 1: python write
with open(filename,"w") as f:
f.write('Hello World')
Example 2: python functions
#Functions
def string():
print('This is a function')
print(string())
with open(filename,"w") as f:
f.write('Hello World')
#Functions
def string():
print('This is a function')
print(string())