Easy Tech Previous Years Solved Sample Placement Papers
- Python supports the creation of anonymous functions at runtime, using a construct called —–
(a) pi
(b) anonymous
(c) lambda
(d) none of the mentioned
Answer: (c) lambda - Which of the following is true for variable names in Python?
(a) underscore and ampersand are the only two special characters allowed
(b) unlimited length
(c) all private members must have leading and trailing underscores
(d) none of the mentioned
Answer: (b) unlimited length - Which of the following functions is a built-in function in python?
(a) factorial()
(b) print()
(c) seed()
(d) sqrt()
Answer: (b) print() - Which of the following is the use of id() function in python?
(a) Every object doesn’t have a unique id
(b) Id returns the identity of the object
(c) All of the mentioned
(d) None of the mentioned
Answer: (b) Id returns the identity of the object - 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
Answer: (b) A folder of python modules - What will be the output of the following Python function?
len([”hello”,2, 4, 6])
(a) Error
(b) 6
(c) 4
(d) 3
Answer: (c) 4 - Which one of the following is not a keyword in Python language?
(a) pass
(b) eval
(c) assert
(d) nonlocal
Answer: (b) eval - What arithmetic operators cannot be used with strings in Python?
(a) ∗
(b) –
(c) +
(d) All of the mentioned
Answer: (b) – - Which of the following statements is used to create an empty set in Python?
(a) ( )
(b) [ ]
(c) {}
(d) set()
Answer: (d) set() - To add a new element to a list we use which Python command?
(a) list1.addEnd(5)
(b) list1.addLast(5)
(c) list1.append(5)
(d) list1.add(5)
Answer: (c) list1.append(5) - Which one of the following is the use of function in python?
(a) Functions don’t provide better modularity for your application
(b) you can’t also create your own functions
(c) Functions are reusable pieces of programs
(d) All of the mentioned
Answer: (c) Functions are reusable pieces of programs - Which of the following is a Python tuple?
(a) {1, 2, 3}
(b) {}
(c) [1, 2, 3]
(d) (1, 2, 3)
Answer: (d) (1, 2, 3) - 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
Answer: (a) conversion of a Python object hierarchy into byte stream - To terminate a loop we use the statement
(a) stop
(b) break
(c) terminate
(d) end
Answer: (b) break