Question: In lab 7 _ p 7 . py two lists are created with integer number values that represent the number of cats and dogs in

In lab7_p7.py two lists are created with integer number values that represent the number of cats and dogs in
a network of animal shelters around Charlotte. Complete the program to perform the following tasks:
Sort the cats list into decreasing order
Ask the user for the number of cats a new shelter has and add the value as a new element at position with
index 1 in the cats list (increasing the number of elements in cats by one)
Ask the user for the number of dogs a new shelter has and add the value as the first element in the dogs
list (increasing the number of elements in dogs by one)
Create the list pets which contains the sums of the corresponding values in the 2 lists (cats and dogs)
Find the total number of pets across the whole network of animal shelters
Display the pets list
Your output might look something like this:
34,9,8,8,7,6,4
Enter the number of cats for the new shelter: 2
Enter the number of dogs for the new shelter: 3
cats in each shelter: 34,2,9,8,8,7,6,4
dogs in each shelter: 3,5,23,14,30,10,15,7
Pets in each shelter: 37,7,32,22,38,17,21,11
Pets in all shelters 185
 In lab7_p7.py two lists are created with integer number values that

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 Databases Questions!