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
編輯內容
列印
嵌入
更多
作業
排行榜
顯示更多
顯示更少
此排行榜當前是私有的。單擊
共用
使其公開。
資源擁有者已禁用此排行榜。
此排行榜被禁用,因為您的選項與資源擁有者不同。
還原選項
測驗
是一個開放式範本。它不會為排行榜生成分數。
需要登錄
視覺風格
字體
需要訂閱
選項
切換範本
顯示所有
播放活動時將顯示更多格式。
打開結果
複製連結
QR 代碼
刪除
恢復自動保存:
?