Question
You should use the CSV module (documentation) https://docs.python.org/3/library/csv.html to read the contents of the attached file orders.csv into a dictionary (not a list). The keys
You should use the CSV module (documentation) https://docs.python.org/3/library/csv.html to read the contents of the attached file orders.csv into a dictionary (not a list). The keys of the dictionary should be orderNumber's from the CSV file, and the values should be the deliveryDate's from the CSV file.
The structure of the attached CSV file is:
[orderNumber], [deliveryDate]
Once everything is in the dictionary, iterate through the dictionary using a loop and on each iteration of the loop, output a notification for each order in this format:
"Thank you for using the promo code ”10PCTOFF”. A 10% discount was applied to order #[orderNumber]. Your backpack will be delivered on or before [deliveryDate].
(for each string output as above, orderNumber and deliveryDate should correspond to entries in the dictionary)
Python
Input from CSV file, Dictionary practice
WHAT TO SUBMIT: Your code in this text box below.
I'm unable to upload on here so here is the download link for the CSV file: https://www.dropbox.com/scl/fi/2464umtzog0oblb0a8nlw/orders.csv?rlkey=ja3cock8cbfvgkbgfa721wrwd&dl=0
Step by Step Solution
3.50 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
You can use the csv module in Python to read the contents of the CSV file into a dictionary and t...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