Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello, I am unsure how exactly to do this section, i only get one change once i submit my answer that is it i cannot
Hello, I am unsure how exactly to do this section, i only get one change once i submit my answer that is it i cannot change it. i am using Codio/Python
4.4. Writing a text file Writing a Text File Submit Answer You can write the contents of a variable out to a file, all at once, like this: 7 # open our fila for uriting 10 #krita "text", to the fi(a at ,filapath 11 file1.rite(taxt) 12 file1.close) Notice that the file was opened with the option, which tells the system to write to the file. Also note that the we closed the file. To read the contents of the file that was just written, open the file again for reading with theoption this time at line 15 14 # print out tha contants of tha fit 15 fila1 apan(Filapath. 'r' 16 print(fila1.read)) 17 fila1.closs) RUN THE WRITE SAMPLE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started