Question 8 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.
Imports the ‘os module’
Checks if the file already exists
Prints error message if the file already exists
If the file doesn’t exist, creates a new file
Output
Made by
Davneet Singh
Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo
Hi, it looks like you're using AdBlock :(
Displaying ads are our only source of revenue. To help Teachoo create more content, and view the ad-free version of Teachooo... please purchase Teachoo Black subscription.
Please login to view more pages. It's free :)
Teachoo gives you a better experience when you're logged in. Please login :)