0% found this document useful (0 votes)
306 views

Question Bank

This document outlines a Python programming course divided into 5 units that covers fundamental Python concepts like data types, operators, conditional and loop statements, functions, classes and objects, file handling, exceptions, modules and packages, GUI programming with Tkinter, and web application development with Django framework. The course introduces basic syntax and features of Python through examples and exercises on various topics to help students learn and apply their Python skills.

Uploaded by

mr. potter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
306 views

Question Bank

This document outlines a Python programming course divided into 5 units that covers fundamental Python concepts like data types, operators, conditional and loop statements, functions, classes and objects, file handling, exceptions, modules and packages, GUI programming with Tkinter, and web application development with Django framework. The course introduces basic syntax and features of Python through examples and exercises on various topics to help students learn and apply their Python skills.

Uploaded by

mr. potter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

SUB: PYTHON PROGRAMING

UNIT 1

1. What is implicit conversion? Give example.


2. List the various operators supported in Python.
3. What are identifiers? List the rules to name an identifier.
4. Write short notes on data types in Python.
5. What is slicing operator? How can you extract a substring from a given string?
6. Discuss about various data types with examples.
7. Explain standard type built in functions in Python?
8. Explain various logical operators used in Python.
9. Write a program in Python to print area and perimeter of a circle.
10. Write a short note on conditional branching statements supported by Python.
11. Explain syntax of FOR loop.
12. With the help of an example, explain the utility of range().
13. Differentiate between pass and continue statement.
14. Define function and give its advantages.
15. Can a function call another function? Justify your answer with the help of an example.
16. ‘The return statement is optional’. Justify this statement with an example.
17. What do you understand by the term arguments? How do we pass them to a function?
18. What are variable-length arguments? Explain with the help of a code.
19. Write short notes on
a. Keyword arguments
b. Default arguments
20. Python strings are immutable. Comment on this statement.
21. Write a function to reverse a string if its length is a multiple of 4.
UNIT 2

1. What is file? Explain the concept of File as a persistent storage.


2. Write a Python program to read the contents of the file named ‘test.txt’.
3. Enlist various file/access functions supported by os module.
4. Differentiate between absolute and relative path.
5. Write a program to compare two files.
6. How can you handle exceptions in Python?
7. Explain the syntax of try – except block.
8. How can you handle multiple exceptions in a program?
9. Explain any three built-in exceptions with relevant examples.
10. What are modules?
11. Write a module for displaying the Fibonacci series.
12. Explain the concept of namespace with suitable example.
13. What is global,local and built in namespace?
14. What are module attributes? Explain.
15. Explain the import statement in Python with necessary illustration.
16. What are Lambdas? Illustrate with an example.
17. What is Functional Programming? Write a program to illustarte map() with and without
Lambda function.
18. Explain the following:
a. filter()
b. reduce()
19. Write a program to illustrate Iterators in Python.
20. Write a program to illustrate Genrator function in Python.
Unit 3

1. Explain about classes and objects in Python programming with an example.


2. What are the different variable defined in class? Explain about purpose of each type.
3. How instance variables differ from class variables?
4. Explain about the access modifiers that are supported by the Python.
5. What is a constructor? How do you define constructor in Python? What is the purpose
of using constructor?
6. Compare constructor and method.
7. What is a self variable?
8. Discuss the different python object related methods with examples.
9. What is garbage collection?
10. Elaborate the different attribute related methods.
11. What is inheritance and explain types of inheritance.
12. Differentiate between base class and derived class.
13. Explain super() function with an example.
14. Explain multiple inheritance with an example.
15. How does inheritance allow users to reuse code?
16. What is multilevel inheritance?
17. What will happen when a call inherits from another class with the same attributes or
methods? Will it override them?
18. Differentiate between the following
19. Simple, multiple & multilevel inheritance
20. Inheritance and composition
21. Containership and aggregation
22. What are abstract classes? Explain with an example.
23. Define the term operator overloading with an example.
24. List advantages of operator overloading.
25. Differentiate between _add_, _radd_, and _iadd_ functions.
26. When is the _call()_ method invoked.

Unit 4

1. What are widgets? Give examples of commonly used widgets?


2. Write a program to display menu on the menu bar.
3. Write a program with an entry box. Message typed by the user must be printed on the
IDLE.
4. Write a program to display a pop-up dialog box.
5. Give a brief description about Tkinter package.
6. Explain in detail about turtle module.
7. Explain about radio button in Tkinter. How to create for Indian or not, on the same
canvas.
8. Write a program for basic web browser using Tkinter which should have a Text widget
where the user can enter a URL and a Canvas to display the contents of the page.
9. Write a Python program that works as a simple calculator. Use a grid to arrange buttons
for the digits and for the +, -,*, % operations. Add a text field to display the result.
10. Develop a Python GUI application that receives an integer in one text field, and
computes its factorial Value and fills it in another text field, when the button named
“Compute” is clicked.
11. Write a Python program that creates a user interface to perform integer divisions. The
user enters two numbers in the text fields, Num1 and Num2. The division of Num1 and
Num2 is displayed in the Result field when the Divide button is clicked. If Num1 or
Num2 were not an integer Num2 is Zero, the program should Display an appropriate
message in the result field in Red color.
12. Write a Python program that simulates a traffic light. The program lets the user select
one of three lights: red, yellow, or green. When a radio button is selected, the light is
turned on, and only one light can be on at a time. No light is on when the program starts.
Unit 5

1. Explain Model Template View(MTV) framework.


2. Explain Django Architecture? List the advantages of using Django.
3. What are models in Django?
4. Explain user authentication in Django?
5. What is the difference between a project and an app in Django?
6. What is the difference between a project and an app in Django?
7. What databases are supported by Django? How to configure database?
8. Create a Django web application for a simple calculator with basic operations (+, -
, * and /) with two numbers.
9. Create a Django web application that implements Library MIS, which has the
features like
a. Add/Delete a book
b. Issue a book to a person
c. Collect a book from a person
d. Search for a title or author
10. Create a Django web application that implements a bus reservation system, where
a new bus can be added/removed with a given source and destination. A user should
be able to reserve or cancel a seat.

You might also like