What is the output of the following code? Explain.
Answer:
Output:
Hello, world!
How are you ?
Explanation:
- Line 1 - opens file in write mode.
- Line 2 & 3 - Writes the 2 lines to the opened file.
- Line 4 - close the text file.
- Line 5 - reads the content in the text file.