0% found this document useful (0 votes)
3 views3 pages

Shortened Module Wise Questions Python

The document outlines the module-wise questions for the Introduction to Python Programming course at Dr. T. Thimmaiah Institute of Technology. It includes various topics such as flow control statements, functions, data structures, string methods, file handling, and object-oriented programming concepts. Each module contains specific programming tasks and theoretical questions aimed at enhancing students' understanding of Python programming.

Uploaded by

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

Shortened Module Wise Questions Python

The document outlines the module-wise questions for the Introduction to Python Programming course at Dr. T. Thimmaiah Institute of Technology. It includes various topics such as flow control statements, functions, data structures, string methods, file handling, and object-oriented programming concepts. Each module contains specific programming tasks and theoretical questions aimed at enhancing students' understanding of Python programming.

Uploaded by

chinnudeepub
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Dr.T.

THIMMAIAH INSTITUTE OF TECHNOLOGY


(Estd. 1986) Oorgaum, Kolar Gold Fields, Karnataka – 563120
(Affiliated to VTU, Belgaum, Approved by AICTE - New Delhi)
NA AC Accredited 'A' Grade

Module wise Questions

Subject: Introduction to Python Programming

Subject Code: BPLCK205B

Course Coordinator: Mrs. Jillian Rufus J

MODULE 1
1. What is flow control statement? Discuss if and if else statements with flow chart
2. Write a function to calculate factorial of a number. Develop a program to compute
binomial coeffiecient (Given N and R) [Lab program- 2b]
3. Develop a python program to generate Fibonacci sequence of length N. Read N from the
console. [ Lab program- 2a]
4. Explain two ways of importing modules in to application in python with syntax and
suitable programming examples.
5. Explain four scope rules of variables in python
6. Discuss various methods of importing modules in python programs. Which method is
best?Explain
7. Explain the math operators in python from highest to lowest precedence with an example
for each. Write the steps how python is evaluating the expressions
(5-1)*((7+1)/(3-1)) and reduces it to a single value.
8. Explain Local and Global scope in python programs. What are local and global variables?
How can you force a variable in a function to refer to the global variable?
9. What is Exception Handling? How exceptions are handled in python? Write a python
program with exception handling code to solve divide-by-zero error situation.
10. Explain the rules of presidence used by python to evaluate an expression
11. What is user define function? Write a function to check if a given number is prime or not.

MODULE 2
1. Explain with a programming example to each i)get() ii)setdefault()
2. Develop suitable python programs with nested lists to explain [Link]() and
[Link]() methods
3. Explain append() and index() functions with respect to lists in python.
4. Read a multi-digit number (as chars) from the console. Develop a program to print the
frequency of each digit with suitable message. [lab program – 4]
5. Discuss list and dictionary data structure with example for each
6. What are the different methods supports in python list. IIustrate all the methods with an
example
7. Discuss get(), keys(),item() and values() dictionary methods in python with examples
8. What is dictionary? Illustrate with an example python program the usage of nested
dictionary

MODULE 3
1. List out all the useful string methods which supports in python. Explain with an example
for each method
2. Explain python string handling methods with examples:
split(),endswith(),ljust(),center(),lstrip() join(), startswith(), rjust(),strip(), rstrip()
3. Explain with suitable python program segments: i) [Link]() ii)[Link]()
4. Develop a python program to find the total size of all the files in the given directory
5. Explain password locker project with an example
6. Develop a program to print 10 most frequently appearing words in a text files (Lab
Program – 5)
7. Develop a program to sort the contents of a text file and write the sorted contents in to a
separate text file. (Lab Program-6)
8. Explain reading and saving python program variables: using shelve module with suitable
python program.
9. Develop a python program to read and print the contents of a text file
10. Explain project adding bullets to wiki markup
11. Write the difference between absolute path and relative path

MODULE 4
1. Explain permanent delete and safe delete with a suitable python programming example to
each. 08M
2. Develop a program to backing up a given folder in to a zip file by using relevant modules
and suitable methods. (Lab program-7)
3. Explain the role of Assertions in python with a suitable program.
4. Explain the functions with examples: i) [Link]() ii) [Link]()
iii)[Link]()
5. Explain the support for logging with logging module in python.
6. Develop a function named DivExp which takes 2 parameters a, b and return a value c
(c=a/b). Write a suitable assertion for a>0 in function DivExp and raise an exception for
when b=0. Develop a program which reads 2 values from console and calls a function
DivExp. (Lab program-8)
7. What is traceback? Explain with example.
8. Describe the concept of logging. Also discuss the levels of logging.
9. How to organize a file using shutil module
10. Explain the concept of saving variables with the [Link]() function
11. Explain walking a directory tree in detail and write python program to display all the
folders, subfolders and file names.

MODULE 5

1. Explain the methods __init__ and __str__with suitable code example to each
2. Explain the program development concept ‘prototype and patch’ with suitable example
3. Define a function which takes two objects representing complex numbers and returns
new complex number with a addition of two complex numbers. Define a suitable class
“Complex’ to represent the complex number.
Develop a program to read N (N>=2) complex numbers and to compute the addition of N
complex numbers (Lab Program – 9)
4. Explain the following with syntax and suitable code snippet:
i)Class definition ii) instantiation iii) passing an instance (or objects) as an argument iv)
instances as return values
5. Define pure function and modifier. Explain the role of pure functions and modifiers in
application development with suitable python programs.
6. Create a Time class with hour, min and sec as attributes. Demonstrate how two time
objects would be added. 08M
7. Discuss polymorphism and demonstrate with python program 08M
8. Explain classes, objects and attributes in python language with example
9. Describe the concept of copying an object
10. What is operator overloading? Write a python code to overload+, _ and * operators by
providing the methods __add__, __sub__ and __mul__
11. Explain operator overloading and polymorphism with examples.
12. What is a programmer-defined type explain with example
13. Illustrate the concepts of inheritance and class diagrams with examples.
14. Using prototype of add_timecode, explain object class definition.

You might also like