The document is a multiple-choice questionnaire (MCQ) focused on Python programming language concepts and features. It includes questions about the language's creator, data types, operators, and syntax. Each question provides four answer options, testing knowledge on various aspects of Python.
The document is a multiple-choice questionnaire (MCQ) focused on Python programming language concepts and features. It includes questions about the language's creator, data types, operators, and syntax. Each question provides four answer options, testing knowledge on various aspects of Python.
1. Wick van Rossum 2. Rasmus Lerdorf 3. Guido van Rossum 4. Niene Stom
Q2 Is Python code compiled or interpreted?
1. Python code is both compiled and interpreted 2. Python code is neither compiled nor interpreted 3. Python code is only compiled 4. Python code is only interpreted Q3 What will be the value of the following Python expression? 4+3%5 1. 7 2. 2 3. 4 4. 1 Q4 Which of the following is the truncation division operator in Python? 1. | 2. // 3. / 4. % Q5 Which of the following is not a core data type in Python Programming? 1. Tuples 2. Lists 3. Class 4. Dictionary Q6 What is the order of namespaces in which Python looks for an identifier? 1. Python first searches the built – in namespace, then the global namespace and finally the local namespace 2. Python first searches the built – in namespace, then the local namespace and finally the global namespace 3. Python first searches the local namespace, then the global namespace and finally the built – in namespace 4. Python first searches the global namespace, then the local namespace and finally the the built – in namespace Q7 Which of the following is not a keyword in Python language? 1. pass 2. eval 3. assert 4. nonlocal Q8 What arithmetic operators cannot be used with strings in Python? 1. * 2. – 3. + 4. All of the above Q9 To add a new element to a list we use which python command? 1. List1.addEnd(5) 2. List1.addLast(5) 3. List1.append(5) 4. List1.add(5) Q10 What is the maximum possible length of an identifier in Python? 1. 79 characters 2. 31 characters 3. 63 characters 4. None of the above Q11 Which of the following is a feature of Python DocString? 1. In Python all functions should have a doctring 2. Docstrings can be accessed by the doc attribute on objects 3. It provides a convenient way of associating documentation with Python modules, functions, classes and methods 4. All of the above Q12 In which year was the Python 3.0 version developed? 1. 2008 2. 2000 3. 2010 4. 2005 Q13 What is the method inside the class in python language? 1. Object 2. Function 3. Attribute 4. Argument Q14 Which one of the following has the highest precedence in the expression? 1. Division 2. Subtraction 3. Power 4. Parenthesis Q15 What will be the output after the following statements? X=5, y=4, print(x%y) 1. 0 2. 20 3. 1 4. 11 Q16 What is the data type of x after the following statement? “x=[‘Today’, ‘Tomorrow’, ‘Yesterday’]” 1. List 2. Dictionary 3. Tuple 4. String Q17 Which of the following cannot be a variable? 1. Init 2. In 3. It 4. On Q18 A function in Python begins with which keyword? 1. Void 2. Return 3. Def 4. Int Q19 Which of the following declarations is incorrect? 1. _x=2 2. X=3 3. Xyz=5 4. None of the above Q20 Which of the following statements assigns the value 25 to the variable x in Python? 1. X<_25 2. X=25 3. X:=25 4. Intx=25 Q21 Select the correct example of complex datatype in Python? 1. 3+2j- 2. 100j 3. 5j 4. All of the above are correct Q22