0% found this document useful (0 votes)
0 views4 pages

Python MODULE Question

The document outlines a comprehensive curriculum for an Introduction to Python Programming course, divided into five modules covering various topics such as control statements, data structures, file handling, and object-oriented programming. Each module includes specific questions and programming tasks designed to enhance understanding and practical skills in Python. Key concepts include functions, lists, dictionaries, classes, and file operations, along with projects like generating quiz files and working with Excel spreadsheets.

Uploaded by

yyyt59983
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)
0 views4 pages

Python MODULE Question

The document outlines a comprehensive curriculum for an Introduction to Python Programming course, divided into five modules covering various topics such as control statements, data structures, file handling, and object-oriented programming. Each module includes specific questions and programming tasks designed to enhance understanding and practical skills in Python. Key concepts include functions, lists, dictionaries, classes, and file operations, along with projects like generating quiz files and working with Excel spreadsheets.

Uploaded by

yyyt59983
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/ 4

COMPUTER SCIENCE AND ENGINEERING

Introduction to Python Progamming ( 2nd SEM)

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.

� Project: Generating Random Quiz Files


6. Design a Python program to generate multiple quiz files containing randomly ordered
questions and answer options from a predefined question bank using dictionaries.
Explain the logic and steps involved.

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.

� Working with Excel Spreadsheets using openpyxl


8. How do you read and write Excel files using the openpyxl module? Write a Python
program to read a worksheet and compute the total of each column.
9. Write a program using openpyxl to create a marksheet Excel file that contains the
names and scores of students in three subjects. Add formulas to calculate the total and
average.
10. List the steps to install and use openpyxl. Explain with a program how you can update
a specific cell value and save the changes in an existing Excel workbook.

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.

� Classes and Functions


6. Define a class Time with attributes hours, minutes, and seconds. Write pure functions
that take Time objects as parameters and return new Time objects.
7. What are pure functions and modifiers in object-oriented programming? Differentiate
between them with examples using a class BankAccount.

� Classes and Methods


8. Explain the role of the __init__ and __str__ methods in Python classes. Write a class
Book with appropriate attributes and methods to demonstrate their usage.
9. What is operator overloading? How can it be implemented in Python? Write a class
ComplexNumber and overload the + operator to add two complex numbers.
10. Explain type-based dispatch and polymorphism in object-oriented programming.
Write an example to demonstrate how the same function behaves differently for
different object types.

3
Dept of CSE
COMPUTER SCIENCE AND ENGINEERING
Introduction to Python Progamming ( 2nd SEM)

11. Discuss the concept of interface and implementation in object-oriented programming.


How does Python support this concept? Provide an example.
12. Write a Python class that represents a Student and includes a method to display the
details. Add another method that calculates the grade based on marks. Demonstrate
object-oriented features like encapsulation and data hiding.

4
Dept of CSE

You might also like