ITI COPA Python MCQ [PDF] 95 Important New Question

ITI COPA Python MCQ PDF Most important New Questions and answers for Online CBT Exam Paper preparation. Python is a new Topic added by DGE&T Department in Year July 2022. This Question Bank is Free for ITI Students.

ITI COPA Python MCQ

1. Is Python code compiled or interpreted?

a) Python code is both compiled and interpreted

b) Python code is neither compiled nor interpreted

c) Python code is only compiled

d) Python code is only interpreted

Ans. a

2. What does pip stand for python?

a) Pip Installs Python

b) Pip Installs Packages

c) Preferred Installer Program

d) All of the mentioned

Ans. c

3. What will be the output of the following Python function?

min(max(False,-3,-4), 2,7)

a) -4
b) -3
c) 2
d) False

Ans. d

4. What are the two main types of functions in Python?

a) System function

b) Custom function

c) Built-in function & User defined function

d) User function

Ans. c

5. Is Python case sensitive when dealing with identifiers?

a) No

b) Yes

c) Machine dependent

d) None of these

Ans. b

6. Which of the following functions can help us to find the version of python that we are currently working on?

a) sys.version(1)         

b) sys.version(0)

c) sys.version()           

d) sys.version

Ans. d

7. Python supports the creation of anonymous functions at runtime, using construct called ____

a) pi    

b) anonymous   

c) lambda    

d) none of these

Ans. c

8. What is the order of precedence in python?

a) Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

b) Exponential, Parentheses, Division, Multiplication, Addition, Subtraction

c) Parentheses, Exponential, Multiplication, Division, Subtraction, Addition

d) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

Ans. d

9. 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

Ans. b

10. 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

Ans. b

11. Which of the following is not a core data type in Python programming?

a) Tuples

b) Lists

c) Class

d) Dictionary

Ans. c

12. 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

Ans. b

13. 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

14. What is the order of namespaces in which Python looks for an identifier?

a) Python first searches the built-in namespace, then the global namespace and finally the local namespace

b) Python first searches the built-in namespace, then the local namespace and finally the global namespace

c) Python first searches the local namespace, then the global namespace and finally the built-in namespace

d) Python first searches the global namespace, then the local namespace and finally the built-in namespace

Ans. c

15. Which one of the following is not a keyword in Python language?

a) pass            

b) eval            

c) assert         

d) nonlocal

Ans. b

16. Which module in the python standard library parses options received from the command line?

a) getarg        

b) getopt        

c) main                       

d) os

Ans. b

17. Which of the following statements is used to create an empty set in Python?

a) ( )   

b) [ ]   

c) { }    

d) set()

Ans. d

18. 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)

Ans. c

19. 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

Ans. c

20. What will be the output of the following Python code?

x = ‘abcd’

for i in range(len(x)):

    print(i)

a) error          

b) 1 2 3 4        

c) a b c d        

d) 0 1 2 3

Ans. d

21. Which of the following is a Python tuple?

a) {1, 2, 3}

b) {}

c) [1, 2, 3]

d) (1, 2, 3)

Ans. d Explanation: Tuples are represented with round brackets.

22. What will be the output of the following Python expression?

round(4.576)

a) 4     

b) 4.6  

c) 5     

d) 4.5

Answer: c

23. Which of the following is a feature of Python DocString?

a) In Python all functions should have a docstring

b) Docstrings can be accessed by the __doc__ attribute on objects

c) It provides a convenient way of associating documentation with Python modules, functions, classes, and methods

d) All of the mentioned

Ans. d

24. What is output of print(math.pow(3, 2))?

a) 9.0              

b) None          

c) 9     

d) None of the mentioned

Answer: a

Explanation: math.pow() returns a floating point number.

25. 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

26. What is the maximum length of a Python identifier?

a) 32

b) 16

c) 128

d) No fixed length is specified

Ans. d

27. Which of the following concepts is not a part of Python?

a) Pointers

b) Loops

c) Dynamic Typing

d) All of these

Ans. a

28. Which of the following statements are used in Exception Handling in Python?

a) try  

b) except        

c) finally         

d) All of these

Ans. d

29. Which of the following types of loops are not supported in Python?

a) for  

b) while          

c) do-while     

d) None of these

Ans. c

30. Which of the following is the proper syntax to check if a particular element is present in a list?

a) if ele in list

b) if not ele not in list

c) Both A and B

d) None of these

Ans. c

31. What will be the output of the following code snippet?

a = [1, 2]

print(a * 3)

a) Error

b) [1, 2]

c) [1, 2, 1, 2]

d) 1, 2, 1, 2, 1, 2]

Ans. d

32. What will be the output of the following code snippet?

example = [“Sunday”, “Monday”, “Tuesday”, “Wednesday”];

del example[2]

print(example)

a) [‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’]

b) [‘Sunday’, ‘Monday’, ‘Wednesday’]

c) [‘Monday’, ‘Tuesday’, ‘Wednesday’]

d) [‘Sunday’, ‘Monday’, ‘Tuesday’]

Ans. b

33. What will be the type of the variable sorted_numbers in the below code snippet?

numbers = (4, 7, 19, 2, 89, 45, 72, 22)

sorted_numbers = sorted(numbers)

print(sorted_numbers)

a) List

b) Tuple

c) String

d) Int

Ans. a

34. What will be the output of the following code snippet?

s = {1, 2, 3, 3, 2, 4, 5, 5}

print(s)

a) {1, 2, 3, 3, 2, 4, 5, 5}

b) [1, 2, 3, 4, 5}

c) {1, 5}

d) None of these

Ans. b

35. Which of the following functions converts date to corresponding time in Python?

a) strptime()   

b) strftime()   

c) Both A and B          

d) None of these

Ans. a

36. As what datatype are the *args stored, when passed into a function?

a) List             

b) Tuple          

c) Dictionary              

d) None of these

Ans. b

37. As what datatype are the *kwargs stored, when passed into a function?

a) Lists

b) Tuples

c) Dictionary

d) None of these

Ans. c

38. Which of the following blocks will always be executed whether an exception is encountered or not in a program?

a) try

b) except

c) finally

d) None of these

Ans. c

39. What keyword is used in Python to raise exceptions?

a) raise

b) try

c) goto

d) except

Ans. a

40. Which of the following are valid escape sequences in Python?

a) \n   

b) \t    

c) \\    

d) All of these

Ans. d

ITI COPA Python MCQ PDF Download
COPA Mock Test [ITI MCQ Quiz]
ITI COPA Java MCQ [PDF] 130 Most important Questions
ITI COPA Cloud Computing MCQ [PDF] 50 Important Question
ITI COPA MCQ Questions [PDF]