Python – Unit-wise Question Set
Section A: Multiple Choice Questions (1 mark each)
1. Which of the following is not a Python data type?
A) int B) float C) real D) complex
2. Which operator has the highest precedence?
A) + B) * C) ** D) and
3. Which of the following creates a tuple?
A) [1,2,3] B) (1,2,3) C) {1,2,3} D) <1,2,3>
4. Which module is used for regular expressions?
A) regex B) pyregex C) re D) match
5. What does break do in a loop?
A) Skips current iteration B) Ends loop C) Pauses loop D) Repeats loop
6. Which of these is used to define a function?
A) def B) function C) define D) fun
7. Which method reads one line from a file?
A) read() B) readline() C) readlines() D) readfile()
8. Django follows which design pattern?
A) MVP B) MVC C) MVT D) MVVM
9. Which keyword is used to access a global variable inside a function?
A) public B) extern C) global D) scope
10. Which of the following is a membership operator?
A) is B) in C) == D) &
Section B: Medium Questions (6 marks each)
1. Explain Python variables, numeric data types, and string operations with suitable
examples.
2. Write and explain Python programs demonstrating if-elif-else, for loop, while loop, break,
and continue.
3. Define functions with examples including parameters, arbitrary arguments, keyword
arguments, and variable scope.
4. Explain file handling in Python. Write programs to read, write, and manipulate text files.
5. What is Django? Explain MVC/MVT architecture and demonstrate how URLs, templates,
and data rendering work.