Write a function get_total_price(class_list) that takes in a list of class call numbers and outputs the total price of all textbooks in the class list. Use the catalog list of dictionaries in the provided catalog.py file to look up a variety of information about a bookstore catalog. Hint: To access the file from within your solution, you should add an import catalog call to the top of your Python file. by calling catalog. catalog. this is the catalog file: csci = {"abbreviation":"CSCI", "department":"Computer Science", "classes": [{"number": "1133", "textbook": "Programming in Python", "price":60.00}, {"number": "3081W", "textbook": "UML Distilled", "price":45.00}, {"number": "4041", "textbook": "Introduction to Algorithms", "price":70.00}, {"number": "4511W", "textbook": "Artificial Intelligence", "price": 159.99}, {"number": "5511", "textbook": "Artificial Intelligence", "price": 159.99}]} chen = {"abbreviation":"CHEN", "department":"Chemical Engineering", "classes": [{"number": "3101", "textbook":"Chemical, Biochemical, & Engineering Thermodynaics", "price":78.95}, {"number": "3006", "textbook":"Separation Process Principles", "price":106.50}, {"number": "4214", "textbook":"Polymer Chemistry", "price":135.00}, {"number": "4708", "textbook":"Chemical Rate Processes", "price":211.25}, {"number": "8101", "textbook":"Incompressible Flow", "price":175.00}]} chem = {"abbreviation":"CHEM", "department":"Chemistry", "classes": [{"number": "1907", "textbook":"Food Lab", "price":33.00}, {"number": "2301", "textbook":"Organic Chemistry", "price":40.00}, {"number": "4021", "textbook":"Essentials of Computational Chemistry", "price":80.00}, {"number": "4701", "textbook":"Inorganic Chemistry", "price":260.00}, {"number": "8552", "textbook":"Principles of Quantum Mechanics", "price":102.65}]} biol = {"abbreviation": "BIOL", "department":"Biology", "classes":[{"number": "2012", "textbook":"Animal Diversity", "price":177.50}, {"number": "3272", "textbook":"Analysis of Biological Data", "price":168.80}, {"number": "4003", "textbook":"Genetics", "price": 44.25}, {"number": "4004", "textbook":"Molecular Cell Biology", "price":167.50}, {"number": "5309", "textbook":"Molecular Ecology", "price":151.00}]} ling = {"abbreviation": "LING", "department":"Linguistics", "classes":[{"number":"1912", "textbook":"Art of Language Invention", "price": 12.95}, {"number": "3601", "textbook":"Trask's Historical Linguistics", "price": 61.80}, {"number": "4201", "textbook":"Syntax: A Generative Introduction", "price":33.50}, {"number": "4302W", "textbook":"Introductory Phonology", "price":40.40}, {"number":"5206", "textbook":"Pragmatics", "price":33.95}]} bskt = {"abbreviation": "BSKT", "department":"Basket Weaving", "classes":[{"number": "1091", "textbook": "Basket Arts", "price":101.50}, {"number": "2223", "textbook": "Physics of Basket Weaving", "price":68.33}, {"number": "3104", "textbook": "Underwater Basket Weaving", "price":149.95}, {"number": "5103", "textbook": "Basket Weaving in Midair", "price": 43.10}, {"number": "8001", "textbook": "Zero Gravity Weaving Arts", "price":50.50}]} catalog = [csci, chen, chem, biol, ling, bskt]

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a function get_total_price(class_list) that takes in a list of class call
numbers and outputs the total price of all textbooks in the class list. Use the catalog list of
dictionaries in the provided catalog.py file to look up a variety of information about a
bookstore catalog. 
Hint: To access the file from within your solution, you should add an import catalog call to
the top of your Python file.
by calling catalog. catalog.

 

this is the catalog file:

csci = {"abbreviation":"CSCI", "department":"Computer Science",
"classes": [{"number": "1133", "textbook": "Programming in Python", "price":60.00},
{"number": "3081W", "textbook": "UML Distilled", "price":45.00},
{"number": "4041", "textbook": "Introduction to Algorithms", "price":70.00},
{"number": "4511W", "textbook": "Artificial Intelligence", "price": 159.99},
{"number": "5511", "textbook": "Artificial Intelligence", "price": 159.99}]}

chen = {"abbreviation":"CHEN", "department":"Chemical Engineering",
"classes": [{"number": "3101", "textbook":"Chemical, Biochemical, & Engineering Thermodynaics", "price":78.95},
{"number": "3006", "textbook":"Separation Process Principles", "price":106.50},
{"number": "4214", "textbook":"Polymer Chemistry", "price":135.00},
{"number": "4708", "textbook":"Chemical Rate Processes", "price":211.25},
{"number": "8101", "textbook":"Incompressible Flow", "price":175.00}]}

chem = {"abbreviation":"CHEM", "department":"Chemistry",
"classes": [{"number": "1907", "textbook":"Food Lab", "price":33.00},
{"number": "2301", "textbook":"Organic Chemistry", "price":40.00},
{"number": "4021", "textbook":"Essentials of Computational Chemistry", "price":80.00},
{"number": "4701", "textbook":"Inorganic Chemistry", "price":260.00},
{"number": "8552", "textbook":"Principles of Quantum Mechanics", "price":102.65}]}

biol = {"abbreviation": "BIOL", "department":"Biology",
"classes":[{"number": "2012", "textbook":"Animal Diversity", "price":177.50},
{"number": "3272", "textbook":"Analysis of Biological Data", "price":168.80},
{"number": "4003", "textbook":"Genetics", "price": 44.25},
{"number": "4004", "textbook":"Molecular Cell Biology", "price":167.50},
{"number": "5309", "textbook":"Molecular Ecology", "price":151.00}]}

ling = {"abbreviation": "LING", "department":"Linguistics",
"classes":[{"number":"1912", "textbook":"Art of Language Invention", "price": 12.95},
{"number": "3601", "textbook":"Trask's Historical Linguistics", "price": 61.80},
{"number": "4201", "textbook":"Syntax: A Generative Introduction", "price":33.50},
{"number": "4302W", "textbook":"Introductory Phonology", "price":40.40},
{"number":"5206", "textbook":"Pragmatics", "price":33.95}]}

bskt = {"abbreviation": "BSKT", "department":"Basket Weaving",
"classes":[{"number": "1091", "textbook": "Basket Arts", "price":101.50},
{"number": "2223", "textbook": "Physics of Basket Weaving", "price":68.33},
{"number": "3104", "textbook": "Underwater Basket Weaving", "price":149.95},
{"number": "5103", "textbook": "Basket Weaving in Midair", "price": 43.10},
{"number": "8001", "textbook": "Zero Gravity Weaving Arts", "price":50.50}]}

catalog = [csci, chen, chem, biol, ling, bskt]

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education