Question
- - Bloodroot Sanguinaria canadensis 4 Mostly Shady $2.44 031599 - Columbine Aquilegia canadensis 3 Mostly Shady $9.37 030699 - Marsh Marigold Caltha palustris 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
A garden center has an XML (plant_catalog.xml) file that stores information, including price, for all plants they sell. The store is having a sale where everything is 20% off. Write a program that that prints the plant "COMMON" name, the current price, and the new sale price. An example of what the output should look like is shown below:
Bloodroot $2.44 to $1.95
Columbine $9.37 to $7.50
Marsh Marigold $6.81 to $5.45 ...
File absolute path: "plant_catalog.xml" Hint: You will need to use "string indexing".
Attached is an example of the plant_catalog.xml file that would be used in the exercise. Using Python, Jupyter, PC. Thank you.
Exercise 4 A garden center has an XML (plant_catalog.xml) file that stores information, including price, for all plants they sell. The store is having a sale where everything is 20% off. Write a program that that prints the plant "COMMON" name, the current price, and the new sale price. An example of what the output should look like is shown below: Bloodroot $2.44 to $1.95 Columbine $9.37 to $7.50 Marsh Marigold $6.81 to $5.45 File absolute path: "plant_catalog.xml" Hint: You will need to use "string indexing". In [ ]: # Use this code to look at the structure of plant_catalog.xml # n = number of lines to show n = 26 with open("plant_catalog.xml") as myfile: head = [next(myfile) for x in range(n)] print("'.join(head)) In [ ]: # Write code here Exercise 4 A garden center has an XML (plant_catalog.xml) file that stores information, including price, for all plants they sell. The store is having a sale where everything is 20% off. Write a program that that prints the plant "COMMON" name, the current price, and the new sale price. An example of what the output should look like is shown below: Bloodroot $2.44 to $1.95 Columbine $9.37 to $7.50 Marsh Marigold $6.81 to $5.45 File absolute path: "plant_catalog.xml" Hint: You will need to use "string indexing". In [ ]: # Use this code to look at the structure of plant_catalog.xml # n = number of lines to show n = 26 with open("plant_catalog.xml") as myfile: head = [next(myfile) for x in range(n)] print("'.join(head)) In [ ]: # Write code hereStep 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