x = {'A': 10, 'B': 20, 'C': 20} abs = {'A':2,'B':3} tot={} total=50 for key,value in x.items(): if key in abs: days = total-abs[key] tot[key] = days*x[key] else: tot[key]=total*x[key] print(tot)
l_w_cost={"mahesh":500,"Ramesh":400,"Mithilesh":400,"Jagmohan":1000,"Rampyare":800} total_cost=0 for i in range(0,50): for j in l_w_cost: total_cost=total_cost+l_w_cost[j] print(total_cost) #sub Jagmohan for 7 days for i in range(0,7): total_cost=total_cost-l_w_cost["Jagmohan"] print(total_cost) #sub Mahesh for 3 days for i in range(0,3): total_cost=total_cost-l_w_cost["Ramesh"] print(total_cost) 155000 148000 146800
Hi Manish, my solution: labour_with_cost = {"Mahesh":500,"Ramesh":400,"Mithlesh":400,"Sumesh":300,"Jagmohan":1000,"Ram":800} # print(labour_with_cost) labour_absent = {"Mahesh":3,"Jagmohan":7} for name in labour_absent: labour_absent[name] = -labour_absent[name] * labour_with_cost[name] print(labour_absent) Total_days = 50 for name in labour_with_cost: labour_with_cost[name] = labour_with_cost[name] * Total_days print(labour_with_cost) print(f"Total labour cost is {sum(labour_with_cost.values())+sum(labour_absent.values())}") Pls reply if we have better solution, Thanks.
hours_worked = 50 total = 0 labour_with_cost = {"Mahesh":500, "Ramesh":400, "Mithilesh":400, "Sumesh":300, "Jagmohan":1000, "Rampyare":800} hours_absent = {"Mahesh":3, "Jagmohan":7} for k in labour_with_cost: if k in hours_absent.keys(): total += labour_with_cost[k] * (hours_worked - hours_absent[k]) else: total += labour_with_cost[k]* hours_worked print(total)
My Solution of the Assignment labour_with_cost={"Mahesh":500,"Ramesh":400,"Mithilesh":400,"Samesh":300,"Jagmohan":1000,"Rampyare":800} total=(labour_with_cost["Mahesh"])*47+labour_with_cost["Ramesh"]*50+labour_with_cost["Mithilesh"]*50+labour_with_cost["Samesh"]*50+(labour_with_cost["Jagmohan"])*43+labour_with_cost["Rampyare"]*50 print("Total Labour_cost",total)
Manish Bhai, i am also working in Reliance Jio at RCP Ghansoli. I want to switch into data side roles but not getting calls. Please make a video on how to get data engineering interview calls. I am very very frustrated with my current job.
# Assignment - Total Labour cost if the total working days was 50 out of which Mahesh was absent for 3 days and Jagmohan was abesnt for 7 days. Find out the total labour cost. #I have tried this out without using for loop labourer_with_cost= {"Mahesh":500,"Ramesh":400,"Mithlesh":400,"Sumesh":300} print(labourer_with_cost) labourer_with_cost["Jagmohan"]=1000 labourer_with_cost["Rampyare"]=800 print(labourer_with_cost) print(" A: Total Labour cost for a day: ",sum(labourer_with_cost.values())) print(" B: Total Labour cost for 50 day: ",50*sum(labourer_with_cost.values())) print(" C: Total labour cost for Mahesh for 3 days: ",3*labourer_with_cost['Mahesh']) print(" D: Total labour cost for Rampyare for 7 days: ", 7*labourer_with_cost['Jagmohan']) print("Total Labour cost if the total working days was 50 and Mahesh and Jagmohan was absent for 3 and 7 Days respectively would be A*50 which is B minus (C + D) : ",50*sum(labourer_with_cost.values())- 3*labourer_with_cost['Mahesh'] - 7*labourer_with_cost['Jagmohan']) Output - {'Mahesh': 500, 'Ramesh': 400, 'Mithlesh': 400, 'Sumesh': 300} {'Mahesh': 500, 'Ramesh': 400, 'Mithlesh': 400, 'Sumesh': 300, 'Jagmohan': 1000, 'Rampyare': 800} A: Total Labour cost for a day: 3400 B: Total Labour cost for 50 days: 170000 C: Total labour cost for Mahesh for 3 days: 1500 D: Total labour cost for Rampyare for 7 days: 7000 Total Labour cost if the total working days was 50 and Mahesh and Jagmohan was absent for 3 and 7 Days respectively would be A*50 which is B minus (C + D) : 161500