1) Which method is used to read file line by line a) read() b) readlines() c) readline() d) line() 2) Select the correct method to write a list of lines to a file a) write(list) b) writelines(list) c) writelist(list) 3) Select all true statements when a file is opened using the with statement a) The with statement simplifies exception handling b) The file is automatically closed after leaving the block, and all the resources that are tied up with the file are released. c) File reading and writing are faster using the with statement. 4) Select the correct mode to open a file for appending as well as reading a) a+ b) ar c) rw d) ar+ 5) Select the correct output of the following code :fp.seek(5, 1) a) Move file pointer five characters ahead from the current position. b) Move file pointer five characters ahead from the beginning of a file. c) Move file pointer five characters behind from the current position. d) Move file pointer five characters behind ahead from the end of a file.
0%
python quiz
แชร์
แชร์
แชร์
โดย
Heyarjun51
แก้ไขเนื้อหา
สั่งพิมพ์
ฝัง
เพิ่มเติม
กำหนด
ลีดเดอร์บอร์ด
แสดงเพิ่มขึ้น
แสดงน้อยลง
ลีดเดอร์บอร์ดนี้ตอนนี้เป็นส่วนตัว คลิก
แชร์
เพื่อทำให้เป็นสาธารณะ
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานโดยเจ้าของทรัพยากร
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานเนื่องจากตัวเลือกของคุณแตกต่างสำหรับเจ้าของทรัพยากร
แปลงกลับตัวเลือก
แบบทดสอบ
เป็นแม่แบบแบบเปิดที่ไม่ได้สร้างคะแนนสำหรับลีดเดอร์บอร์ด
ต้องลงชื่อเข้าใช้
สไตล์ภาพ
แบบ อักษร
ต้องสมัครสมาชิก
ตัวเลือก
สลับแม่แบบ
แสดงทั้งหมด
รูปแบบเพิ่มเติมจะปรากฏเมื่อคุณเล่นกิจกรรม
เปิดผลลัพธ์
คัดลอกลิงค์
คิวอาร์โค้ด
ลบ
คืนค่าการบันทึกอัตโนมัติ:
ใช่ไหม