+ 8
What's wrong with this code ? 😕
I wrote this code as my first try to make my first files rewrite function 😃 and it tells me in line 9 the name 'project' is not defined 😑 so how can I define it ? 😕 here's the code : def file_rewrite(filename): file = open(filename,"w") file.write("hello") file.close() myfile = open("project.txt","w") myfile.close() print(file_rewrite(project.txt)) file_opening = open("project.txt","r")
4 Answers
+ 12
Missing " " ?
+ 11
Tashi is right. You're missing the quotes in filename argument.
+ 7
thank you all for replying I thought it didn't need the quotes cause it's a function 😐
+ 1
i think there is missing quotes " "