Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how do I do this in python? Given a dictionary as follows: courses = { 'bash': {'classes': 20, 'hours': 2, 'fee': 50}, PHP': {'classes': 10,
how do I do this in python?
Given a dictionary as follows: courses = { 'bash': {'classes': 20, 'hours': 2, 'fee': 50}, PHP': {'classes': 10, 'hours': 2, 'fee': 150}, 'Angular': {'classes': 25, 'hours': 2, 'fee': 100}, Python': {'classes': 15, 'hours': 2, 'fee': 100} } Write a function called calculate_fees (courses) that takes in courses as an input parameter which is a dictionary of dictionaries. The dictionary of dictionaries is of the above given format (course name as key followed by an inner dictionary of classes, hours and fee). The function returns the total fees for each of the courses separately as elements of a list. The total fee is calculated as: Total Fee = No. of classes * No. of hours * fee For example, for the given courses above, the function should return: [2000, 3000, 5000, 3000] Sample Input: {'Java': {'classes': 20, 'hours': 2, 'fee': 50}, "Python': {'classes': 14, 'hours': 2, 'fee': 150}} Sample Output: [2000, 4200]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started