Using Python’s ElementTree XML API, write a Python program to perform the follow
ID: 3752614 • Letter: U
Question
Using Python’s ElementTree XML API, write a Python program to perform the following tasks below.
Note that your program’s execution syntax must be as follows:
python xmlparse.py plant_catalog.xml plantName percentChange
1. Using ElementTree, read in this assignments XML file plant_catalog.xml specified by a command line parameter as shown above.
2. Find the plant by the name passed in as an argument on the command line (plantName above).
3. Once found, read the current price and adjust it by the command line argument percentChange. Note that this value could be anything in the range of -90 < percentChange < 100.
Explanation / Answer
As ther is no xml file so used the below format if u have diff tags in xml please do let me know
#save the below xml as plant_catalog.xml
#save the below code as xmlparse.py
# run using command
python xmlparse.py plant_catalog.xml mango 10
# after running the command xlml file:
Please do let me know in case of any concern...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.