Buy us a coffee

Python se file read karna - open() aur with

  • Intermediate
  • Module 2 of 11 in this level
  • Open to learn
Start this skill

Watch

Watch the video to unlock the quizquiz खोलने के लिए video देखें

What you should understandआपको क्या समझना है?

  • open() से file खुलती है और read() से उसका content मिलता है।
  • with लिखकर खोलने पर file अपने आप बंद हो जाती है।
  • File न मिलने पर error आता है, जिसे try से संभाला जा सकता है।