0% found this document useful (0 votes)
47 views2 pages

A11 - A12 - 0557 - Advance Python Programming - Winter 2021-22 - Midterm

The document outlines the questions and instructions for a mid-term examination in Advance Python Programming. It includes 5 questions covering topics like data types in Python, list methods, binary search, lambda functions, and inheritance. Students are asked to write functions to check if a student arrived excusably late, generate Fibonacci sequences, perform binary search, explain lambda and built-in functions, and override methods in an inherited Bus class.

Uploaded by

Nidhi Sharma
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)
47 views2 pages

A11 - A12 - 0557 - Advance Python Programming - Winter 2021-22 - Midterm

The document outlines the questions and instructions for a mid-term examination in Advance Python Programming. It includes 5 questions covering topics like data types in Python, list methods, binary search, lambda functions, and inheritance. Students are asked to write functions to check if a student arrived excusably late, generate Fibonacci sequences, perform binary search, explain lambda and built-in functions, and override methods in an inherited Bus class.

Uploaded by

Nidhi Sharma
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/ 2

Reg. No.

:
Name :

Mid-Term Examinations – March 2022


Programme : MCA Semester : Winter 2021-22
Course : Advance Python Programming Code : MCA2022
Faculty : Md Shah Fahad Slot/ Class No. : A11+A12/0557
Time : 1 ½ hours Max. Marks : 50

Answer all the Questions

Sub.
Q.No. Question Description Marks
Sec.

1 In Python, compare the data types list, dictionary, set, and tuple. Why do we need an
array in Python programming when we already have a list? 10

2 (a) We are using python lists to record students who attended our class and what order
they arrived in. For example, the following list represents a class with 8 students, in
which ‘Jahurul’ showed up first and ‘Arif ‘ was the last to arrive:

students = ['Jahurul', 'Nazmul', 'Nayeem', 'Swapna', 'Ahad', 'Munia', 'Al-amin',


'Arif']
A student is considered 'Excusably late' if they arrived after at least half of the 5
participants. However, they must not be the very last participant (that's taking it too
far). In the above example, Ahad, Munia, and Al-amin are the only students who were
excusably late. Write a function that takes a list of students and the name of one
student and prints whether that person is “excusably late”. If the student is not in the
list, print “Student was absent”

(b) Write a recursive function using python programming to display the Fibonacci
sequence. 5

3 Take an array of 'N' students from the user. In some cases, your teacher may want to
look up the name of a specific student within a group of 'N' students. If the desired
student is found in the array, display "student found," otherwise "student not found."
To find the specific student's name, write a binary search function in Python 10
programming.

4 What is the lambda function in python? Explain lambda function with example.
Explain filter(), map(), and reduce() function in brief.
10

5 Create a Bus child class that inherits from the Vehicle class. The default fare charge of
any vehicle is seating capacity * 100. If Vehicle is Bus instance, we need to add an
extra 10% on full fare as a maintenance charge. So total fare for bus instance will
10
become the final amount = total fare + 10% of the total fare.

Note: The bus seating capacity is 50. so the final fare amount should be 5500. You
Page 1 of 2
need to override the fare() method of a Vehicle class in Bus class. (Use python
programming)



Page 2 of 2

You might also like