Check sibling questions

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.

 

Introducing your new favourite teacher - Teachoo Black, at only ₹83 per month

CA Maninder Singh's photo - Expert in Practical Accounts, Taxation and Efiling

Made by

CA Maninder Singh

CA Maninder Singh is a Chartered Accountant for the past 12 years. He also provides Accounts Tax GST Training in Delhi, Kerala and online.