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