Python MODULE Question
Python MODULE Question
Module -1
1) Differentiate between break and continue statements.
2) Explain in detail the various data types in Python Programming Language.
3) Differentiate between for Loop and while Loop with Python code.
4) Explain in detail about the various Operators in Python Programming Language.
5) Explain if, else and elif statements with flow diagram and example.
6) Mention the different types of operators, descriptions and suitable examples
related to python arithmetic and comparison operators
7) Write a python program to add n numbers accepted from the user.
8) Write a function to calculate factorial of a number. Develop a program to compute
binomialcoefficient (Given N and R).
9) Explain looping control statements in Python with a syntax and example to each.
10) Develop a Python program to generate Fibonacci sequence of length (N). Read N
from the console
11) List and explain math operators used in python wih example.
12) Explain the rules of precedence used by python to evaluate an arithmetic
expression also explain the arithmetic operators used in python.
Module-2
1. What is a function? How to define a function in python? Write a program using
function to find out the given string is palindrome or not.
2. What is local and global scope of variable in python .Explain the different scenarios
with an example snippet
3. What is list? Explain the concept of slicing and indexing with proper examples.
4. What are the different methods supports in python List. Illustrate all the methods with
an example.
5. How to handle exceptions in Python explain with an example.
6. Explain the following list methods with examples.
⚫index(), append(), insert(), ⚫sort(), ⚫reverse().
7. Explain in and not in operators used in lists with an example.
8. Show that lists are mutable.
9. Tuples are immutable. Explain with Python programming example
10. Develop Magic 8 ball program using list.
11. Analyze the use of argumented assignment operator in python?
12. Explain python function with parameters and return statements and return values.
13. Explain the list data types With examples.
14. Explain the References And its functions.
15. Develop a program to guess the number.
16. Explain random.choice and random.shuffle functions with lists.
1
Dept of CSE
COMPUTER SCIENCE AND ENGINEERING
Introduction to Python Progamming ( 2nd SEM)
Module-3
1. Discuss list and dictionary data structure with example for each.
2. For a=[‘hello’, ‘how’, [1,2,3], [[10,20,30]]] what is the output of following
statement (i) print( a[ : : ] ) (ii) print(a[-3][0]) (iii) print(a[2][ : -1]) (iv)
print(a[0][ : : -1])
3. write a python program to read dictionary data and delete any given key entry in
the dictionary.
4. Explain with a programming example to each: (ii) get() (iii) setdefault()
5. Difference between list & dictionaries.
6. Explain the methods of dictionaries.
7. Explain Pretty printing with example in python.
8. Explain Python string handling methods with examples: split(),endswith(), ljust(),
center(), lstrip()
9. Explain Python string handling methods with examples: join(),
startswith(),rjust(),strip(),rstrip()
10. Explain the string methods with examples.
11. Explain the string slicing with examples.
12. Explain the Password Locker with example.
Module -4
1. Explain the steps involved in reading and writing text files in Python. Write a program
that reads a text file and writes its content in reverse order to another file.
2. Discuss the significance of file paths and the os.path module in Python file handling.
Write a program to check whether a given path exists and whether it's a file or a
directory.
3. Describe the file reading and writing process in Python with examples. How do
modes like 'r', 'w', and 'a' affect file operations? Demonstrate using a program.
4. What is the shelve module in Python? How does it differ from normal file writing?
Write a program that stores and retrieves student details using the shelve module.
5. Explain the use of the print.format() function for formatting output. Write a program
to accept employee details and save the data into a file with properly formatted
columns.
2
Dept of CSE
COMPUTER SCIENCE AND ENGINEERING
Introduction to Python Progamming ( 2nd SEM)
� Project: Multi-clipboard
7. What is a multi-clipboard program? Write a Python script that stores and retrieves
clipboard text snippets using the pyperclip and shelve modules. Explain its use cases.
Module -5
1. Explain how to define a class and create objects in Python. With an example, show
how attributes are assigned and accessed.
2. What are attributes in Python classes? Explain with an example how to define and use
attributes in a custom class called Rectangle.
3. Discuss how instances can be used as return values from functions. Write a Python
program that defines a class Circle and returns an instance of it from a function.
4. Explain the concept of mutability with respect to objects in Python. Write a program
to demonstrate that objects are mutable.
5. What are the different ways of copying objects in Python? Illustrate the difference
between shallow copy and deep copy with an example using a user-defined class.
3
Dept of CSE
COMPUTER SCIENCE AND ENGINEERING
Introduction to Python Progamming ( 2nd SEM)
4
Dept of CSE