Python Questions March 20, 2023 | No Comments 0 votes, 0 avg 601 123456789101112131415 Python Questions 1 / 15 1. What will be the output of the following Python code? def func(a, b=5, c=10): print('a is', a, 'and b is', b, 'and c is', c) func(3, 7) func(25, c = 24) func(c = 50, a = 100) A. a is 7 and b is 3 and c is 10 a is 25 and b is 5 and c is 24 a is 5 and b is 100 and c is 50 B. a is 3 and b is 7 and c is 10 a is 5 and b is 25 and c is 24 a is 50 and b is 100 and c is 5 C. a is 3 and b is 7 and c is 10 a is 25 and b is 5 and c is 24 a is 100 and b is 5 and c is 50 D. None of the mentioned 2 / 15 2. Which of the following counts the number of elements in Numpy array ? A. count() B. return() C. shape() D. size() 3 / 15 3. What is called when a function is defined inside a class? A. Module B. Class C. Another Function D. Method 4 / 15 4. Which of the following concepts is not a part of Python? A. Pointers B. Loops C. dynamic typing D. All of the above 5 / 15 5. The following python program can work with ____ parameters. def f(x): def f1(*args, **kwargs): print("JAVA") return x(*args, **kwargs) return f1 A. any number of B. O C. 1 D. 2 6 / 15 6. Which of the following is true for variable names in Python? A. underscore and ampersand are the only two special characters allowed B. variable names can be of unlimited length C. all private members must have leading and trailing underscores D. All of the above 7 / 15 7. The process of pickling in Python includes ____________ A. conversion of a Python object hierarchy into byte stream B. conversion of a datatable into a list C. conversion of a byte stream into Python object hierarchy D. conversion of a list into a datatable 8 / 15 8. Which of the following character is used to give single-line comments in Python? A. // B. # C. ! D. /* 9 / 15 9. What will be the output of the following Python code? x = 'abcd' print(list(map(list, x))) A. [‘a’, ‘b’, ‘c’, ‘d’] B. [[‘a’], [‘b’], [‘c’], [‘d’]] C. [‘abcd’] D. none of the above 10 / 15 10. What is the order of precedence in python? A. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction B. Exponential, Parentheses, Division, Multiplication, Addition, Subtraction C. Parentheses, Exponential, Multiplication, Division, Subtraction, Addition D. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction 11 / 15 11. Which of the following functions converts date to corresponding time in Python? A. strptime() B. strftime() C. both A and B D. All of the above 12 / 15 12. Which of the following is used to define a block of code in Python language? A. Indentation B. Keys C. Brackets D. All of the above 13 / 15 13. Which of these is the definition for packages in Python? A. A set of main modules B. A folder of python modules C. A number of files containing Python definitions and statements D. A set of programs making use of Python modules 14 / 15 14. Consider the results of a medical experiment that aims to predict whether someone is going to develop myopia based on some physical measurements and heredity. In this case, the input dataset consists of the person’s medical characteristics and the target variable is binary: 1 for those who are likely to develop myopia and 0 for those who aren’t. This can be best classified as A. Regression B. Decision Tree C. Clustering D. Association Rules 15 / 15 15. What will be the output of the following code snippet? def tester(**kwargs): for key, value in kwargs.items(): print(key, value, end = " ") tester(Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4) A. Sunday 1 Monday 2 Tuesday 3 Wednesday 4 B. Sunday 1 C. Wednesday 4 D. none of the above Your score isThe average score is 37% LinkedIn Facebook VKontakte 0% Restart quiz By WordPress Quiz plugin Questions, Quiz