InterviewSolution
| 1. |
Please answer this if you know python. |
|
Answer» ming Language :- ★ Python ★{\Python " : 3tprice = 0tup = [[1.'Raman','2'OPD','5600'],[2.'Shiva','6','Private'12000']]F= open(filename,'w')g= open('recpt.txt','r')LINES = g.readlines()for line in lines: base = line.split() tup.append(base)print('S.no','\t','Patients Name ','\t','No.of day','\t',' Room ','\t','PRICE')for i in range(len(tup)): if len(tup[i][0]) <= 7: print([i+1],'\t',tup[i][0],'\t','\t',tup[i][2],'\t',tup[i][1]) else: print([i+1], '\t', tup[i][0], '\t', tup[i][2],'\t',tup[i][1]) price = int(tup[i][1]) tprice += priceprint(tprice)S.no|PatientsName|No.of day|Room|Price1. ____Raman ______2.___OPD.__56002. ____Shiv _____6.___Private.__12000__________________________________ |
|