Which line creates an empty dictionary?, {}, dict(), Both A and B, [], Which data type is immutable?, List, Set, Dictionary, Tuple, Which symbol is used for comments?, //, #, %, /*, Which keyword is used to handle exceptions?, Catch, Except, Error, Throw, Which module generates random numbers?, math, random, os, sys, Which keyword skips the current iteration?, break, stop, continue, pass, What is the output? print(10%3), 3, 1, 0, 10, Which keyword creates an anonymous function?, lambda, func, anonymous, define, What is the output? print("5" + "5"), 10, 55, error, 25, Which function removes all items from a list?, remove(), delete(), clear(), pop(), Which statement is true?, Tuples are mutable., Lists are immutable., Strings are immutable., Sets allow duplicate values., Which keyword is used to create a generator?, generate, return, yield, next, Which function checks the memory address of an object?, id(), type(), mem(), object(), Which data type is unordered?, list, tuple, string, set, What is the output? print("10" * 3), 30, error, 101010, 1000, Which keyword is used to skip writing code inside a function?, skip, continue, break, pass, Which method removes the last item in a list?, remove(), pop(), clear(), delete, Which operator has the highest precedence?, +, **, *, //, What will this print? print(any([0, "", False, 5])), True, False, error, none, Which built-in function returns both the index and value while looping?, range(), enumerate(), zip(), map(), What is the output? print([i*i for i in range(5) if i % 2 == 0]), [0, 1, 4, 9, 16], [0, 4, 16], [1,9], error, Which function is lazy evaluated?, list(), tuple(), dict(), range(), What is the output? x = [[1]*3]*3x[0][0] = 9print(x), [[9,1,1],[1,1,1],[1,1,1]], [[9,1,1],[9,1,1],[9,1,1]], error, [[1,1,1],[1,1,1],[1,1,1]], What is the output? print(bool("False")), False, True, error, none, What is the output? print({1,2,3} & {2,3,4}), {1,2,3,4}, {2,3}, {1,4}, none, Which statement is true?, Dictionary keys must be mutable., Dictionary values must be unique., Lists can be dictionary keys., Dictionary keys must be immutable., What is the output? def f(a=[]): a.append(1) return aprint(f())print(f()), [1][1], [1][1, 1], [][], error, Which principle allows the same method to behave differently based on the object?, Inheritance, Polymorphism, Encapsulation, Abstraction, What is the purpose of the pass statement?, Skip the current loop iteration, Exit the program, Act as a placeholder where code will be added later, Ignore exceptions, What is the main advantage of using generators?, Reduced memory usage by generating values on demand, Faster printing, Easier debugging, Automatic sorting
0%
Python questions
แชร์
แชร์
แชร์
โดย
Arunadev7677
แก้ไขเนื้อหา
สั่งพิมพ์
ฝัง
เพิ่มเติม
กำหนด
ลีดเดอร์บอร์ด
แสดงเพิ่มขึ้น
แสดงน้อยลง
ลีดเดอร์บอร์ดนี้ตอนนี้เป็นส่วนตัว คลิก
แชร์
เพื่อทำให้เป็นสาธารณะ
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานโดยเจ้าของทรัพยากร
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานเนื่องจากตัวเลือกของคุณแตกต่างสำหรับเจ้าของทรัพยากร
แปลงกลับตัวเลือก
แบบทดสอบ
เป็นแม่แบบแบบเปิดที่ไม่ได้สร้างคะแนนสำหรับลีดเดอร์บอร์ด
ต้องลงชื่อเข้าใช้
สไตล์ภาพ
แบบ อักษร
ต้องสมัครสมาชิก
ตัวเลือก
สลับแม่แบบ
แสดงทั้งหมด
รูปแบบเพิ่มเติมจะปรากฏเมื่อคุณเล่นกิจกรรม
เปิดผลลัพธ์
คัดลอกลิงค์
คิวอาร์โค้ด
ลบ
คืนค่าการบันทึกอัตโนมัติ:
ใช่ไหม