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)
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 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")
('Yellow', 237, 250, 68)
.push_Clr(ClrStack, new_Clr)
: This function takes the stack ClrStack and a new record new_Clr as arguments and pushes this new record onto the stack.pop_Clr(ClrStack)
: This function pops the topmost record from the stack and returns it. If the stack is already empty, the function should display the message "Underflow".isEmpty(ClrStack)
: This function checks whether the stack is empty. If the stack is empty, the function should return True, otherwise the function should return False.Rupal, Shanu and Trisha were partners in a firm sharing profits and losses in the ratio of 4:3:1. Their Balance Sheet as at 31st March, 2024 was as follows:
(i) Trisha's share of profit was entirely taken by Shanu.
(ii) Fixed assets were found to be undervalued by Rs 2,40,000.
(iii) Stock was revalued at Rs 2,00,000.
(iv) Goodwill of the firm was valued at Rs 8,00,000 on Trisha's retirement.
(v) The total capital of the new firm was fixed at Rs 16,00,000 which was adjusted according to the new profit sharing ratio of the partners. For this necessary cash was paid off or brought in by the partners as the case may be.
Prepare Revaluation Account and Partners' Capital Accounts.