Lesson 30 of 34
Files: লেখা এবং পড়া
9 min 30 XP
প্রোগ্রাম শেষ হওয়ার পরেও data রাখতে file-এ save করুন। open(name, "w") লেখে, "a" যোগ করে আর "r" পড়ে। with ব্যবহার করলে file নিজেই বন্ধ হয়।
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.লাইন ধরে ধরে পড়তে file-এর ওপর loop চালান। strip() প্রতিটি লাইনের শেষের \n সরায়।
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.এখানে files শুধু আপনার browser-এর ভেতরে থাকে এবং refresh করলে মুছে যায়। কম্পিউটারে Python install করলে আসল files তৈরি হয়।