1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Gemiola [76]
4 years ago
10

Write a function process_spec that takes a dictionary (cmap), a list (spec) and a Boolean variable (Button A) as arguments and r

eturns False: if the spec has a color that is not defined in the cmap or if Button A was pressed to stop the animation Otherwise return True
Computers and Technology
1 answer:
andrew-mc [135]4 years ago
6 0

Answer:

Explanation:

The following code is written in Python. The function takes in the three arguments and first goes through an if statement to check if Button A was pressed, if it was it returns False otherwise passes. Then it creates a for loop to cycle through the list spec and checks to see if each value is in the dictionary cmap. If any value is not in the dictionary then it returns False, otherwise, it returns True for the entire function.

def process_spec(cmap, spec, buttonA):

   if buttonA == True:

       return False

   

   for color in spec:

       if color not in cmap:

           return False

   return True

You might be interested in
Which broad area of data mining applications analyzes data, forming rules to distinguish between defined classes?
patriot [66]

Answer:

Classification.

Explanation:

Classification is the wide field of data mining apps that analyzes data and establishes rules for making a distinction in specified classes.

Data mining is a method that corporations use to transform the raw information into valuable information. Corporations can understand something about their clients through using technology to identify trends in large quantities of info to create more successful marketing campaigns, increase revenue and reduce costs.

6 0
3 years ago
Who invented different photo-capture methods in photography?
geniusboy [140]

Answer:

However, it wasn't until the 19th century that a breakthrough occurred. The world's earliest successful photograph was taken by French inventor Joseph Nicéphore Niépce in 1826. As such, Niépce is considered the world's first photographer and the true inventor of photography as we know it today.

Explanation:

7 0
3 years ago
2. Which pattern microphone should Jennifer take to the press conference? Jennifer is a journalist with one of the leading newsp
Rudiy27

Answer:

dynamic

Explanation:

4 0
3 years ago
What form of contacts can be shared in Outlook 2016?
ArbitrLikvidat [17]

Answer:

shared contacts

Explanation:

5 0
4 years ago
Read 2 more answers
20.
Kazeer [188]

Answer:

Megabyte

Explanation:

Megabytes come before Gigabytes like how Gigabytes come before Terrabytes

8 0
3 years ago
Other questions:
  • Which type of factories began to flourish in the late eighteenth century
    5·1 answer
  • Declare an array reference variable, week, and initialize it to an array containing the strings "mon", "tue", "wed", "thu", "fri
    15·1 answer
  • I really love my voice when not recorded. Now when I record my voice, I feel like its high pitched and horrible. Do I really sou
    11·1 answer
  • What should be done on a tablet in order for that tablet to cease all network connections?
    7·1 answer
  • Asking questions when something is unclear is part of
    5·1 answer
  • Write an if statement that that decreases the variable shelfLife by 4 if the variable outsideTemperature is greater than 90. Ass
    5·1 answer
  • failure of the _ cylinder will often result in sudden unexpected loss of the ability to stop the vehicle
    10·1 answer
  • Assume the following:
    10·1 answer
  • Peer collaboration helps develop critical-thinking skills, which is the ability to
    9·2 answers
  • It is where the home tab is located where you can view all the all the formatting purpose <br>​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!