मराठी

Write a command(s) to write the following lines to the text file named hello.txt. Assume that the file is opened in append mode. “ Welcome my class” “It is a fun place” “You will learn and play” - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Write a command(s) to write the following lines to the text file named hello.txt. Assume that the file is opened in append mode.

“ Welcome my class”
“It is a fun place”
“You will learn and play”

टीपा लिहा

उत्तर

Assumed this statement, as stated in question -

filehandle = open("hello.txt","a")

commands to write following lines are -

1 file_handle = open("hello.txt", "a")
2 file_handle.write("Welcome my class")
3 file_handle.write("It is a fun place")
4 file_handle.write("you will learn and play")
5 file_handle.close()
shaalaa.com
Opening and Closing a Text Files
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 2: File Handling in Python - Exercise [पृष्ठ ३७]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 12
पाठ 2 File Handling in Python
Exercise | Q 6. | पृष्ठ ३७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.