Write a program that checks to see if the file name exists, it will give you an error message, if not, it will create the file.
Answer:
import
os
if
os.path.isfile('sample.txt'):
print
("You are trying to create a file that already exist!")
else:
f = open("sample.txt",'w')