Department of Electronics and Communication Engineering
University BDT College of Engineering, Davangere-577004
(A Constituent College of VTU, Belagavi)
1st SEMESTER: Introduction to Python Programming (BPLCK205B)
ODD Semester: 2024-25
ASSIGNMENT – 1
(Assignment should be written in Assignment Long Note Book available in the College Society)
MODULE-1
1 What are the features of Python?
2 Explain the order of precedence of operators used in Python.
3 Explain the most common data types used in Python with examples.
4 Explain string concatenation and replication with examples.
5 What is an identifier? What are the rules for an identifier? Give examples.
6 Explain print() and input() functions in Python with examples.
7 Explain if, if-else, if-elif statements with flowchart and examples in Python.
8 Explain while loop and for loop with examples in Python.
9 Explain break and continue statements with examples in Python.
10 Explain how functions are defined in Python. Write a program to find factorial of a given
number using functions.
11 Explain with examples, local and global scope of variables in Python.
12 a) Develop a program to read the student details like Name, USN, and Marks in three
subjects. Displaythe student details, total marks and percentage with suitable messages.
b) Develop a program to read the name and year of birth of a person. Display whether the
person is a senior citizen or not. (Lab)
13 a) Develop a program to generate Fibonacci sequence of length (N). Read N from the
console.
b) Write a function to calculate factorial of a number. Develop a program to compute
binomial coefficient(Given N and R) (Lab).
MODULE-2
14 What is a list? Lists are mutable, Justify the statements with example.
15 Explain the concept of list slicing and list traversing with examples.
16 Show with example, how one list containing another list can be accessed using multiple
indexes.
17 Demonstrate how to Change Values in a List using Indexes.
18 With an example how would you explain Negative indexing.
19 Demonstrate how to Remove values from Lists with del Statement.
20 Explain list Concatenation and list Replication with examples.
21 Explain with example, the in and not in Operators wrt lists.
22 Explain Augmented Assignment Operators.
23 What is a method? List and explain the 4 useful methods used with lists in Python
24 Read N numbers from the console and create a list.
Develop a program to print mean, variance andstandard deviation with suitable messages.
(Lab)
25 Read a multi-digit number (as chars) from the Console. Develop a program to print the
frequency ofeach digit with suitable message. (Lab).
26 Read a multi-digit number (as chars) from the console. Develop a program to print the
frequency of each digit with suitable message. (Lab).
Instructions for writing the Assignments:
1. Assignment shall be written in Assignment Long Note Book available in the College Society.
2. Write Dept Vision, Mission, PEOs, PSOs and COs in the Assignment Note Book without fail.
3. All the details (Name, USN, Sem, etc.) shall be written on the cover sheet of assignment long note book with
permanent marker pen.
Department of Electronics and Communication Engineering
University BDT College of Engineering, Davangere-577004
(A Constituent College of VTU, Belagavi)
4. Questions and Answers shall be written serially, and Question Number shall be written as given in Assignment-
1. Skipping of any question & answer will lead to significant deduction in the marks.
5. Question number shall be written clearly within the left margin of the page.
6. Questions shall be written in RED ink, and Answers in BLACK ink.
7. All the diagrams shall be drawn neatly using Pencil/Pen and Scale.
Sd/-
Dr. Reshma.M
Department of Electronics and Communication Engineering
University BDT College of Engineering, Davangere-577004
(A Constituent College of VTU, Belagavi)
1st SEMESTER: Introduction to Python Programming (BPLCK205B)
ODD Semester: 2024-25
ASSIGNMENT –2
MODULE-3
27 Explain indexing and slicing wrt to strings.
28 How in and not in operators are used with strings? Give examples.
29 Explain upper( ), lower( ), isupper( ), and islower( ) String Methods with examples.
30 Explain isX string methods used for strings with examples.
31 Explain join( ) and split( ) String Methods with examples.
32 Explain Justifying Text with rjust( ), ljust( ), and center( ) string methods with examples..
33 Explain Removing Whitespace with strip( ), rstrip( ), and lstrip( ) string methods with
examples.
34 Explain Copying and Pasting Strings with the pyperclip Module.
35 Explain the functions provided by os.path module with examples.
36 Explain the three steps to reading or writing files in Python.
37 How would you explain three os.path module that provides functions to check whether a
given path exists or whether it is a file or folder?
38 Explain in detail how to Save Variables with the shelve Module.
39 Show how Saving Variables with the pprint.pformat() Function.
40 Develop a program to print 10 most frequently appearing words in a text file. [Hint: Use
dictionary with distinct words and their frequency of occurrences. Sort the dictionary in the
reverse order offrequency and display dictionary slice of first 10 items] (Lab).
MODULE-4
41 How would you explain copying files and folders using shutil module
42 Explain with example how Moving and Renaming Files and Folders using shutil
module.
43 Explain with following with example.
1. Safe Deletes with the send2trash Module.
2. Permanently Deleting Files and Folders.
44 What is zip file? How would you explain reading zip file and Extracting from ZIP Files.
45 How would you explain Walking a Directory Tree with example?
46 Develop a program to backing Up a given Folder (Folder in a current working directory) into
a ZIP Fileby using relevant modules and suitable methods. (Lab).
47 Develop a program to sort the contents of a text file and write the sorted contents into a
separate text file.(Lab).
48 Write a function named DivExp which takes TWO parameters a, b and returns a value c
(c=a/b). (Lab).
MODULE-5
49 Define class? How do we define class? How to instantiate the class and members are
accessed?
50 What is pure function? Illustrate the same with example.
51 Explain the concept of polymorphism with suitable example.
52 Explain _init_ method and str method with example.
53 Discuss the type-based dispatch in python.
54 With general syntax explain Operator overloading with example code.
Instructions for writing the Assignments:
1. Assignment shall be written in Assignment Long Note Book available in the College Society.
2. Write Dept Vision, Mission, PEOs, PSOs and COs in the Assignment Note Book without fail.
3. All the details (Name, USN, Sem, etc.) shall be written on the cover sheet of assignment long note book with
Department of Electronics and Communication Engineering
University BDT College of Engineering, Davangere-577004
(A Constituent College of VTU, Belagavi)
permanent marker pen.
4. Questions and Answers shall be written serially, and Question Number shall be written as given in Assignment-
1. Skipping of any question & answer will lead to significant deduction in the marks.
5. Question number shall be written clearly within the left margin of the page.
6. Questions shall be written in RED ink, and Answers in BLACK ink.
7. All the diagrams shall be drawn neatly using Pencil/Pen and Scale.
Sd/-
Dr. Reshma.M