GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Look at the image below. The blue arrows are pointing to ___…

Look at the image below. The blue arrows are pointing to ___.   

Read Details

CODING 2 [10 pts] – The animals are ready to PARTAY! Write a…

CODING 2 [10 pts] – The animals are ready to PARTAY! Write a function called partyAnimals() that takes in 2 lists, animalList and animalDiet. animalList is a list of animal names representing the guests, and animalDiet is the corresponding dish they would like to bring. Return a dictionary partyDict that maps each animal’s name to the dish they will bring, only if the dish starts with the same first two letters as the animal’s name (case-insensitive), and the dish is not another animal guest. Note: animalList and animalDiet are the same length, and each animal appears only once in animalList. Example #1: >>> animalList = [“Chimpanzees”, “Toucans”, “Butterflies”, “Worms”] >>> animalDiet = [“chips”, “worms”, “Butter cookies”, “Organic Matter”] >>> partyAnimals(animalList, animalDiet)Expected Output #1: {‘Chimpanzees’: ‘chips’, ‘Butterflies’: ‘Butter cookies’} Example #2: >>> animalList = [“Shark”, “Bass”, “Shrimp”, “Squid”] >>> animalDiet = [“shrimp”, “BANANAS”, “krill”, “Scallion pancakes”] >>> partyAnimals(animalList, animalDiet) Expected Output #2:{‘Bass’: ‘BANANAS’}

Read Details

[1 pt] What is printed when the following code is executed? …

[1 pt] What is printed when the following code is executed?    print(True or 0 and None or not {}) 

Read Details

(1 pt) Write a poem to your TAs, or draw something for them!

(1 pt) Write a poem to your TAs, or draw something for them!

Read Details

Choose the code segment that, when included in the indicated…

Choose the code segment that, when included in the indicated place within the sortedVowels() function, will result in the function correctly returning a list of the unique sorted vowels contained in the parameter aStr and doing so in the most efficient way.    def sortedVowels(aStr):     vowels = “aeiou”     outlist = []     [ CODE GOES HERE ]     return outlist 

Read Details

Part II [6 pts] – Number Systems   Decimal Binary Hexadec…

Part II [6 pts] – Number Systems   Decimal Binary Hexadecimal 0011 1111 E5 44

Read Details

The following function has been implemented to request a lis…

The following function has been implemented to request a list of values from a user and calculate their average; however, it errors for specific inputs. What test cases reveal the limitations of the current implementation?   def computeAvg():     values = input(“Provide a set of values separated by spaces:”)     listVal = values.split(” “)     total = 0     count = len(listVal)     for val in listVal:         total += int(val)     average = total/count     print(f”The average is {average}.”)      “13 67 01” “12.1 100 23” “5 6 10 8 11” “”

Read Details

You are a rainforest ranger in the Amazon. To understand the…

You are a rainforest ranger in the Amazon. To understand the biodiversity of the rainforest, you plan to record how many of each animal there are. You hope to use a data structure that allows you to store count of each animal along with its name in sorted order from the most frequent to the least. Which data structure is most suitable?

Read Details

Why is the Big-O notation useful when comparing the runtime…

Why is the Big-O notation useful when comparing the runtime of two algorithms?

Read Details

A sad story designed to make the audience feel sympathy appe…

A sad story designed to make the audience feel sympathy appeals to:

Read Details

Posts pagination

Newer posts 1 … 2,024 2,025 2,026 2,027 2,028 … 86,301 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top