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
Chia sẻ
Chia sẻ
Chia sẻ
bởi
Arunadev7677
Chỉnh sửa nội dung
In
Nhúng
Nhiều hơn
Tập
Bảng xếp hạng
Hiển thị thêm
Ẩn bớt
Bảng xếp hạng này hiện đang ở chế độ riêng tư. Nhấp
Chia sẻ
để công khai bảng xếp hạng này.
Chủ sở hữu tài nguyên đã vô hiệu hóa bảng xếp hạng này.
Bảng xếp hạng này bị vô hiệu hóa vì các lựa chọn của bạn khác với của chủ sở hữu tài nguyên.
Đưa các lựa chọn trở về trạng thái ban đầu
Đố vui
là một mẫu kết thúc mở. Mẫu này không tạo điểm số cho bảng xếp hạng.
Yêu cầu đăng nhập
Phong cách trực quan
Phông chữ
Yêu cầu đăng ký
Tùy chọn
Chuyển đổi mẫu
Hiển thị tất cả
Nhiều định dạng khác sẽ xuất hiện khi bạn phát hoạt động.
Mở kết quả
Sao chép liên kết
Mã QR
Xóa
Bạn có muốn khôi phục tự động lưu:
không?