Python Project
Python Project
output:
1|Page
2.
A list contains following record of a customer : [Customer_name, Room_type]
Write the following user defined functions to perform given operations on the
stack named ‘Hotel’ :
(ii ) Pop_Cust() : To pop the names of customers from the stack and
display them. Also, display “Underflow” when there are no customers In the stack.
output:
2|Page
3.WAF Push(Vehicle) where, Vehicle is a dictionary containing details of vehicles -
{Car_name:Maker}. The function should push the name of car manufactured by
‘TATA’ to the stack.
output:
3|Page
4.WA function to create a file and put some text to it. Write another function that reads
this file and print the file contents in reverse.
output:
4|Page
5.WA function to create a file and enter some lines in it. Write another function to
return the size of file in bytes
output:
5|Page
6.WAF to enter student records [rno,name,age] in a binary file. Also write a function to
search for a particular roll number in the file.
output:
6|Page
7.WAF to enter student records {“rno”: rno,”name”:name ,”age”: age] in a binary file.
Also write a function to modify age for a particular roll number in the file.
output:
7|Page
the file.
output:
9.Write a function to create a file and enter some lines in it. Write
8|Page
another function to return the number of words in the file.
output:
9|Page
10.WA function to create a file and enter some lines in it. Write another function to
return the number of lines that begin with a vowel
output:
10 | P a g e
11.Write a function to create a file and enter some lines in it. Write
another function to print number of words in each line.
output:
11 | P a g e