Question: Question 1 : Use any online compiler to answer the below questions and provide screenshots for the code, output, and file. [ This provides evidence
Question : Use any online compiler to answer the below questions and provide screenshots for the
code, output, and file.
This provides evidence for PC
a Write a Python program that creates a file named data.txt using mode.
b Write to this file using the mode the names of friends each on a line
c Read the content of the file using the mode, and print them in the console.
d Append to the file the names of more friends using the a mode.
This provides evidence for PC
e Using the read function, read the first characters of the file.
f Using the readline and loops, read only the first lines of the file.
This provides evidence for PC
g Using the mode, write the name of your favorite subject to the file. Explain what happens to
the content of the file.show the output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
