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
Partajează
Partajează
Partajează
de
Arunadev7677
Editează conținutul
Imprimare
Încorporează
Mai multe
Misiuni
Clasament
Arată mai mult
Arată mai puțin
Acest clasament este în prezent privat. Fă clic pe
Distribuie
pentru a-l face public.
Acest clasament a fost dezactivat de proprietarul resursei.
Acest clasament este dezactivat, deoarece opțiunile tale sunt diferite de ale proprietarului resursei.
Opțiuni de revenire
Chestionar
este un șablon deschis. Nu generează scoruri pentru un clasament.
Este necesară conectarea
Stilul vizual
Fonturi
Este necesar un abonament
Opţiuni
Comutare șablon
Arată tot
Mai multe formate vor apărea pe măsură ce folosești activitatea.
Rezultate deschise
Copiați linkul
Cod QR
Şterge
Restaurare activitate salvată automat:
?