Question: Data file petdata.txt contains client data for a vet office. Each data set is two lines. The first line is the client name. The second

Data file petdata.txt contains client data for a vet office. Each data set is two
lines. The first line is the client name. The second line contains pet names
separated by commas.
1: Reads the pet data from the file into a dictionary. The key is the client name (ex. Jillian Cleaves)
and the value is a list of pet names for that client. Code should use the string split method to read the
pet data and split into a list.
2. Write a display function that is passed the dictionary and displays the client names and their pet
names (see sample output).
3. Write a loop that processes each key in the dictionary. For each client, iterate over pet names and ask
if the pet is a dog and, if so, if the pet needs a rabies shot. Report the charge at $45.00 per shot. If the
client has no dogs, report a message (see sample output).
Include the following functions. Do not change the function headings or purpose. Include the
comments. Other functions may be added as desired.
1. Include the main function at the top of the code
def main ():
2. Write a void function that displays the tree data in a neat chart.
def display (): # display dictionary (see sample output)
*** Code must use a dictionary for credit. ***

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!