Single Choice/ Multiple Choice Easy/ Moderate/ Difficult Topic or Sub-Topic Covered 1 CO1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Department of Computer Science & Engineering

Meerut Institute of Engineering & Technology, Meerut

Session – 2020-21

Subject Python Subject Code KNC -402


Programming
Semester 4th Sem. Year 2nd Year
Total Questions 50 Question SET 1
1. All Questions are compulsory.
2. All Questions carry Equal Marks.
3. 10 MCQs from each Unit.
4. There are 4 sets and each set have 50 questions for practice with answers.
5. All the sets are also available on Google Class to attempt online.

UNIT- 1

Question Difficulty Category Questions Marks CO


Type Level
1. Write your Question here?
Single Easy/ Topic or a) Option 1
1 CO1
Choice/ Moderate/ sub-topic b) Option 2 (Answer should be in bold)
c) Option 3
Multiple Difficult covered d) Option 4
Choice
Single Easy Basic 1. Which of the following is assignment 1 CO2
Choice Operators operator in python?
a) =
b) - =
c)+=
d) //=
Single Easy Basic 2. What is the functionality of <> this operator 1 CO1
Choice Operators in python?
a) It does not exist in python
b) If values of two operands are not equal,
then condition becomes false.
c) If values of two operands are not
equal, then condition becomes true.
d) None of these
Single Moderate Bitwise 3. What is the output for 11110000 & 1 CO2
Choice 00010000
a) 00001111
b) 11110000
c) 00010000
d) None of these
Single Easy Bitwise 4. Which of the following is bitwise operator 1 CO1
Choice in python?
a) ^
b) <<
c) >>
d) |
Multiple Easy Operator 5. Which of the following is membership 1 CO1
Choice operator in python
a) is
b) in
c) not in
d) None of these
Single Easy Operator 6. Which of the following is floor division 1 CO1
Choice operator in python?
a) /
b) //
c) not applicable for python
d) None of these
Single Moderate Operator 7. Choose the correct option regarding 1 CO2
Choice precedence precedence for operator in python.
a) + and - have same precedence
b) ** and * have same precedence
c) * and / does not have same precedence
d) pass
Single Easy Operator 8. Choose the correct output 3**3. 1 CO1
Choice a) 27
b) 9
c) 3
d) None of these
Multiple Easy Equality 9. Which of the following is equality operator 1 CO1
Choice operator in python?
a) ==
b) !=
c) <>
d) None of these
Single Easy Identity 10. Which of the following is identity 1 CO1
Choice operator operator in python?
a) is
b) not is
c) Both a and b
d) None of these
Single Easy Break 11. What ids the function of break 1 CO1
Choice statement statement?
a) Skip all the statement written below
the break
b ) What ids the function of break
statement?
c) It does not work in python
d) None of these
Single Moderate String 12. while(i==8): print("I am ok") how 1 CO3
Choice many time it will execute?
a) 1
b ) infinite loop
c) 8
d)syntax error
Single Easy Loop 13. What is step parameter in range 1 CO2
Choice function?
a) It tells about step-size
b It is optional parameter
c) both a and b
d) None of these
Single Moderate Conditional 14. Choose the correct statement. 1 CO2
Choice statement a) if can execute without else block
b if cannot execute without else block
c) nested if else contain also require
else block for each if block
d) None of these
Single Moderate Conditional 15. If we have three condition and one 1 CO2
Choice statement default case, then the number of if elif
and else block is required respectively.
a) 1,2,1
b) 1,1,1
c) 2,0,2
d) None of these
Single Easy Conditional 16. Choose the correct option regarding if 1 CO2
Choice statement statement
a) It can contain any number of
Boolean expression.
b) It allow only two Boolean
expression
c) It can contain only single Boolean
expression.
d) None of these
Single Easy Conditional 17. Choose the correct option regarding 1 CO2
Choice statement else block in python.
a) else block contain only one Boolean
expression
b it contain only two expression
c) it is default case and does not
contain any Boolean expression.
d) None of these
Single hard Loop 18. Choose the correct option (Ignore the | 1 CO3
Choice in print function of for loop block)
For i in range(4):
Print()
Else:
Print(“I am else”)

a) Syntax error will occur due to else


block
b) else block will be executed
c) syntax error
d) None of these
Multiple Hard Conditional 19. Choose the correct option (Ignore the | 1 CO3
Choice statement in print function of for loop block)
For i in range(4):
Print()
Else:
Print(“I am else”)
a) we will get error at else block
b ) First print function give output 1
234
c) Program execute without any
error
d) None of these
Single Easy loop 20. Nested loop has more time complexity 1 CO1
Choice in comparison to the single loop
a) True
b ) False
c) Cant be concluded
d) None of these
Single Hard Join method 21. Choose the correct output.function? 1 CO3
Choice a=[‘python’,’lecture’,’@mit’]
d=’mit’.join(a)
print(d)
a) pythonmitlecturemit@mit
b pythonmitlecture@mit
c) pythonlecturemit@mit
d) None of these
Single Hard List 22. Choose the correct option 1 CO3
Choice comprehension X=[(a,b) for a in range(3) for b in
range(a)]
Print(x)
a) (0, 0), (0, 1), (1, 0), (1, 1), (2, 0), (2,
1)
b [(0, 0), (0, 1), (1, 0), (1, 1), (2, 0), (2,
1)
c) [(1, 0), (2, 0), (2, 1)]
d) None of these
Single Hard List 23. choose the correct option 1 CO3
Choice comprehension X=[(a,b) for a in range(3) for b in
range(a)]
Print(x)
a) [(0, 0), (0, 1), (1, 0), (1, 1), (2, 1),
(2, 1)]
b (0, 0), (0, 1), (1, 0), (1, 1), (2, 0), (2,
1)
c) It require special execution
d) [(0, 0), (0, 1), (1, 0), (1, 1), (2, 0),
(2, 1)]
Single Easy List function 24. Choose the correct syntax to insert 5 in 1 CO1
Choice a list l at index 3.
a) l.insert(2,5)
b l.insert(2,3)
c) l.insert(5,3)
d) l.insert(3,5)
Multiple Easy Data structure 25. Which of the following data structure 1 CO1
Choice is immutable
a) list
b )tuple
c) string
d) all of these

Single Easy Lambda 26. Lambda function have 1 CO2


Choice function a) single expression
b) single argument
c) multiple expression
d) None of these
Multiple Moderate Lambda 27. Lambda function can contain 1 CO2
Choice function a) many argument
b) many expression
c) It is a single line function
definition
d) None of these
Single Easy dictionary 28. Choose the correct output 1 CO2
Choice Minidict={‘name’:’TutorialsPoint’,
‘name’:’website’}
Print(minidict[‘name’])
a) website
b) TutorialsPoint
c) Syntax error
d) None of these
Single Easy tuple 29. Which of the following is properties of 1 CO1
Choice tuple?
a) Immutable
b ) mutable'
c) Insertion of element is possible
d) all of above
Single Easy Data structure 30. Which data structure in python does 1 CO1
Choice not allow duplicate element?
a) tuple
b) string
c) set
d) None of these
Single Easy Exception 31. A single try statement can have 1 CO2
Choice handling multiple except statements.
a) True
b )False

Single Easy Exception 32. A single try statement can have 1 CO1
Choice handling multiple except statements, help in
a) It does not support in python
b) to handle only one exception
c) to handle many exception
d) None of these
Single Easy Exception 33. Index error exception raised 1 CO1
Choice handling a) This exception is never raised
b) When a key is not found
c) When an index in not found
d) None of these
Single Easy Exception 34. Key error exception 1 CO1
Choice handling a) When specific key is not found in
a sequence
b) The exception does not exist
c) When key exist but program not
working
d) None of these
Single Easy Exception 35. Syntax error exception 1 CO1
Choice handling a) Raise when there is error in
python
b) when there is error in indentation
c) Due to system error
d) None of these
Single Easy Exception 36. Indentation error exception raised 1 CO1
Choice handling a) when there is syntax error
b ) When indentation is not specified
properly
c) When key is not define
d) None of these
Single Easy OOPS 37. Object is 1 CO1
Choice a) an entity that has state and
behavior.
b) an entity that has only state
c) It has only method
d) None of these
Single Easy OOPS 38. Which of the following is based in 1 CO1
Choice oops concept?
a) C++
b ) Java
c) python
d) All of these
Single Easy OOPS 39. What is base class in OOPS concept? 1 CO1
Choice a) Whose inherit all the properties of
another class
b) those class whose properties is
acquired
c) Both a and b
d) None of these
Single Easy OOPs 40. self parameter refers to 1 CO2
Choice a) current instances of the class and
access the class variable.
b) It does not access the class variable.
c) It help to access the method.
d) None of these
Single Easy Insertion sort 41. Best case time complexity of insertion 1 CO1
Choice sort.
a) O(n)
b) O(n2)
c) O(nlogn)
d) None of these
Single Hard sorting 42. Consider a situation where swap 1 CO4
Choice operation is very costly. Which of the
following sorting algorithms should be
preferred so that the numbers of swap
operations are minimized in general?
a) insertion
b) selection
c) Merge sort
d) None of these
Single Moderate sorting 43. Appropriate condition for best case 1 CO2
Choice complexity in case of insertion sort for
increasing order sorting
a) Descending order
b ) All element are identical
c) Random order
d) None of these
Single Hard Tower of 44. Total number of movement for 7 disk 1 CO5
Choice Hanoi in Tower of Hanoi problem
a) 128
b )127
c) 122
d) 126
Single Easy Sorting 45. Time complexity for merge sort 1 CO1
Choice algorithm
a) O(nlogn)
b) O(logn)
c) O(n)
d) None of these
Single Moderate Sorting 46. Recurrence function of merge sort. 1 CO3
Choice a) T(n)=2T(n/2)+O(n)
b) T(n)=2T(n)+1
c) T(n)=2T(n/2)
d) None of these
Single Moderate Tower of 47. Recurrence relation for tower of Hanoi 1 CO3
Choice Hanoi problem
a) T(n)=2T(n-1)+1
b) T(n)=2T(n/2)+1
c) T(n)=2T(n/4)+1
d) None of these
Single Easy sorting 48. Time complexity of binary search 1 CO1
Choice algorithm
a) O(logn)
b) O(nlogn)
c) O(n)
d) None of these
Single Moderate Searching 49. Recurrence relation for binary search 1 CO3
Choice algorithm
a) T(n)=T(n/4)+c
b) T(n)=T(n/2)+c
c) T(n)=T(n)+c
d) None of these
Single Moderate Tower of 50. The number of comparison required to 1 CO2
Choice Hanoi search x=5 for given element 1,2,5,7,9
a) 2
b) 1
c) 4
d) 3

You might also like