Q:
What will be the output of the following Python code?
belongs to collection: Python Multiple Choice Questions And Answers
Python Multiple Choice Questions And Answers
- Given a function that does not return any value, What value is thrown by default when executed in shell
- What is the maximum possible length of an identifier?
- What will be the output of the following Python code?
- What are the values of the following Python expressions?
- What is the value of the following expression?8/4/2, 8/(4/2) The above expressions are evaluated as: 2/2, 8/2, which is equal to (1.0, 4.0)
- What will be the output of the following Python code?
- Given a string example=”hello” what is the output of example.count(‘l’)?
- Read the information given below carefully and write a list comprehension such that the output is: [‘e’, ‘o’]
- What will be the output of the following Python list comprehension?
- The function pow(x,y,z) is evaluated as:
- What will be the output of the following Python function?
- What will be the output of the following Python code? l=[2, 3, [4, 5]] l2=l.copy() l2[0]=88 l l2
- What will be the output of the following Python code and state the type of copy that is depicted? l1=[2, 4, 6, 8] l2=[1, 2, 3] l1=l2 l2
- What will be the output? ef fact(num): if num == 0: return 1 else: return _____________________
- What will be the output of the following Python code? def f1(a,b=[]): b.append(a) return b print(f1(2,[3,4]))
- Program code making use of a given module is called a ______ of the module
- Which function overloads the + operator?
- Which operator is overloaded by __invert__()?
- Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?
- What will be the output of the following Python code?
- What will be the output of the following Python code? t[5]
- Which of the following is not a keyword in Python
- What is the output? print('{:,}'.format(1112223334))
- Select the reserved Keywords
- Which of the folowing is a coreect statement with respect to round()
- Which of these is not a core data type in python
- What is the output? print('{:#}'.format(1112223334))
- All the keywords in python is written in
- Is tuple mutuable
- Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)
- What is the output? 5
- Which command is used to add an element in the list
- Output of 7^10 is
- What is the output? Y=[2,5J,6] Y.sort()
- In which of the following we can use "in" operator to check the elements
- Assume the output : list1 = [1, 2, 3, 4] list2 = [5, 6, 7, 8] print(len(list1 + list2))
- Suppose list1 is [1, 3, 2], What is list1 * 2 ?
- Which of the following statement is correct
- Assume the output values : [[3, 4, 5, 1], [33, 6, 1, 2]] v = values[0][0] for lst in values: for element in lst: if v > element: v = element print(v)
- Output is: l = [1,2,6,5,7,8] l.insert(9)
- Guess the output: a=[14,52,7] b=a.copy() b is a
- Output is: a=[1,2,3,4] b=[sum(a[0:x+1]) for x in range(0,len(a))] print(b)
- Which of the following data type use Key:pair
- Are nested if-else are allowed?
- What will be the output of the following Python code? max("what are you")
- What will be the output. def f1(x): global x x+=1 print(x) f1(15) print(\"hello\")
- What is the output? print([i.lower() for i in \"HELLO\"])
- Predict the output: List = [True, 50, 10] List.insert(2, 5) print(List, \"Sum is: \", sum(List))
- Output is: print(\"Hello {0[0]} and {0[1]}\".format((\'foo\', \'bin\')))
Correct Answer:
Error, private class member can’t be accessed in a subclass