PASSENGERS.DAT stores the records of passengers using the following structure:Create() – to input data for passengers and write it in the binary file PASSENGERS.DAT.SearchDestn(D) – to read contents from the file PASSENGERS.DAT and display the details of those Passengers whose DESTN matches with the value of D.UpdateFare() – to increase the fare of all passengers by 5% and rewrite the updated records into the file PASSENGERS.DAT."P_record.csv" contains the records of patients in a hospital. Each record of the file contains the following data:["Gunjan", "Jaundice", 4, 15000]read_data() which reads all the data from the file and displays the details of all the 'Cancer' patients.count_rec() which counts and returns the number of records in the file.
def Change(X):
for K, V in X.items():
L1.append(K)
L2.append(V)
D = {1: "ONE", 2: "TWO", 3: "THREE"}
L1 = []
L2 = []
Change(D)
print(L1)
print(L2)
print(D)
def ExamOn(mystr):
newstr = ""
count = 0
for i in mystr:
if count % 2 != 0:
newstr = newstr + str(count - 1)
else:
newstr = newstr + i.lower()
count += 1
newstr = newstr + mystr[:2]
print("The new string is:", newstr)
ExamOn("GenX")
Rewrite the given sentences as directed. (Any two)
(i) Rewrite the given sentence after removing 'too'. She is too old to walk.
(ii) Transform the given sentence using 'No sooner dots than'. As soon as he saw the tiger, he took to heels.
(iii) Change the degree of comparison. The peacock is the most beautiful bird.
Translate the following sentences into English. (Any two) 