A11 - A12 - 0557 - Advance Python Programming - Winter 2021-22 - Midterm
A11 - A12 - 0557 - Advance Python Programming - Winter 2021-22 - Midterm
:
Name :
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:
(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