Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python code snippet? numbers = {} letters = {} comb = {} numbers[1] = 56 numbers[3] = 7 letters[4] = 'B' comb['Numbers'] = numbers comb['Letters'] = letters print(comb)
Q2
What will be the output of the following Python code snippet? >>>import collections >>> b=collections.Counter([2,2,3,4,4,4]) >>> b.most_common(1)
Q3
What will be the output of the following Python code snippet? a={1:"A",2:"B",3:"C"} print(a.get(1,4))
Q4
What will be the output of the following Python function? any([2>8, 4>2, 1>2])
Q5
Which built-in function is used to calculate the absolute value of a number?
Q6
What will be the output of the following Python code? >>> a={i: 'A' + str(i) for i in range(5)} >>> a
-
A
-
B
-
C
-
D
Q7
Which built-in function is used to convert a value to an integer?
Q8
What is the output of the following code: my_list = [True, False, True] print(any(my_list))
Q9
What will be the output of the following Python code snippet? d = {"john":40, "peter":45}
Q10
Which built-in function is used to check if all elements in an iterable are true?
Q11
What will be the output of the following Python code? >>> b={} >>> all(b)
Q12
What will be the output of the following Python function? float(‘-infinity’) float(‘inf’)
Q13
What will be the output of the following Python code snippet? >>> import collections >>> a=collections.Counter([2,2,3,3,3,4]) >>> b=collections.Counter([2,2,3,4,4]) >>> a|b
Q14
What does the built-in function bool() do in Python?
Q15
What will be the output of the following Python expression? round(4.5676,2)?
Q16
What will be the output of the following Python expression? round(4.576)
Q17
The function divmod(a,b), where both 'a' and 'b' are integers is evaluated as:
Q18
What does the built-in function enumerate() do in Python?
Q19
What does the built-in function max() do in Python?
Q20
What does the built-in function round() do in Python?
Q21
What will be the output of the following Python function? hex(15)
Q22
What is the purpose of the built-in function dir()?
Q23
Which built-in function is used to find the smallest item in an iterable?
Q24
What does the built-in function hex() do in Python?
Q25
What is the output of the following code: my_string = "Hello, World!" print(my_string.upper())