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
WINSTONCH [101]
3 years ago
15

Write a function fight(first_pokemon, second_pokemon) that takes the dictionaries for two pokemon and computes the winner of a f

ight. The winner of the fight must be the pokemon with the greatest sum of all stats. You must also write a stats(pokemon) function that takes a pokemon's dictionary and returns an integer representing the sum of that pokemon's stats.
Computers and Technology
1 answer:
igomit [66]3 years ago
4 0

Answer: provided in the explanation section

Explanation:

This is actually quite easy to go,i ask that you follow it carefully.

CODE is meant for python3+

CODE

def stats(pokemon):

   total=0

   #loops over the stats list

   for stat in pokemon["stats"]:

       # adds the stat to the total

       total+=stat["base_stat"]

   return total

def fight(first_pokemon,second_pokemon):

   #prints the first statemetn

   print(first_pokemon["name"],"has",stats(first_pokemon),"combined stats.",second_pokemon["name"],"has",stats(second_pokemon),"combined stats.")

   #checks if the first_pokemon wins

   if(stats(first_pokemon)>stats(second_pokemon)):

       print(first_pokemon["name"],"wins!")

   #checks if the second_pokemon wins

   elif(stats(first_pokemon)<stats(second_pokemon)):

       print(second_pokemon["name"],"wins!")

   # it is a draw

   else:

       print("It is a draw")

cheers i hoped this helped !!!

You might be interested in
The merge process involves which two types of files?
Natasha2012 [34]


On Microsoft Word a merge process involves the primary and secondary files. The correct choice is the letter

C. Primary and secondary
<span>
I hope it helps, Regards.</span>
3 0
4 years ago
Bulleted and Numbered List button appear in the ………….. Toolbar.​
stich3 [128]

Answer:

The answer to this question is given below in the explanation section

Explanation:

Bulleted and Numbered List button appear in the <u>Paragraph </u>Toolbar.​

On word processing software, these options display in paragraph toolbar in the Home ribbon.

for example, in MS Word, you can find them in the Home tab under paragraph groups of command.

however, it is noted that these options are appear in some other software under the formating toolbar.

8 0
4 years ago
Assume a system has a TLB hit ratio of 90%. It requires 15 nanoseconds to access the TLB, and 85 nanoseconds to access main memo
andriy [413]

Answer:

310 ns

Explanation:

Given that

TLB hit ratio = 90%

TLB hit ratio = 90/100

TLB hit ratio = 0.9

Time needed to access TLB = 15 ns

Time needed to access main Memory = 85 ns

Effective memory access time = ?.

The formula for finding the effective memory access time is given by

The effective memory access time = [TLB Hit ratio (main memory access time + required time to access TLB) + [2 * (main memory access time + required time to access TLB)] * (2 - TLB hit ratio)]

On substituting the values given in the question to the equation, we have

The effective memory access time = [0.9 (85 + 15) + [2 * (85 + 15)] * (2 - 0.90)]

The effective memory access time =

[(0.9 * 100) + (2 * 100) * 1.1]

The effective memory access time =

(90 + (200 * 1.1))

The effective memory access time =

90 + 220

The effective memory access time =

310 ns

3 0
4 years ago
Read 2 more answers
Name the written test a potential driver must pass
Oliga [24]
In order to obtain a learners permit, teen drivers are required to pass a written test. Typically they will prepare for this exam by completing a drivers education course. Though not a requirement in all states, drivers ed is the easiest way to be thoroughly prepared for the complicated driving laws and scenarios you’ll face on the permit exam. Once you pass your permit test and earn a permit, there may still be certain restrictions attached to this provisional license — such as requiring a licensed driver over a certain age to be seated in the passenger seat, limiting your driving to daylight hours, and other state-mandated rules.
General United States Permit Requirements
While each state has its own set of guidelines, in general, teens between 14 and 18 years of age can start the drivers education and learners permit process. Once a teen driver has obtained a learners permit, there are additional state-specific requirements they must meet before they can apply for their drivers license.
Before obtaining a learners permit in any state, a teenager is required to pass a driving knowledge test. Drivers education is the best way for a teen to prepare for this exam, whether the state requires it or not. In some cases, passing a drivers ed final exam can substitute for the written exam. No matter how the test is taken, students must pass with at least a 70% or higher, depending on that state’s minimum. Once he or she passes, a teen driver will be issued a learners permit. Some states require teen drivers to have a permit for a minimum of 6 months before they can take their drivers license exam.

hope this helped :)
alisa202
7 0
3 years ago
I need help making a rap song of my own !! Ty
Veronika [31]
What are u making it about?
6 0
3 years ago
Read 2 more answers
Other questions:
  • The concept of a process in an operating system embodies two primary characteristics, one of which is:
    15·1 answer
  • How does a hard drive work?
    5·1 answer
  • Write a function that creates a one-dimensional game board composed of agents of two different types (0 and 1, X and O, stars an
    11·1 answer
  • For almost all networks today, including the internet, the communication protocol used is called ____.
    15·1 answer
  • Anyone know the answer I need help
    12·1 answer
  • Name the written test a potential driver must pass and list the minimum required score to earn a learner’s license.
    8·2 answers
  • A(n) ____ is a list of authorization rights attached to an object - in other words, who can access that device or application an
    13·1 answer
  • Why are computer manufacture constantly releases fast computer and do user benefit from ths speed
    9·1 answer
  • Which of the following best explains how devices and information can be susceptible to unauthorized access if weak passwords are
    9·1 answer
  • To print photographs in color.​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!