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
With the help of technology students will benefit greatly from studying by themselves at home. Do you agree or disagree with the
cestrela7 [59]
I disagree because when kids are home alone, and you think they are studying they might not be and they will be playing games on the computer.
6 0
3 years ago
Read 2 more answers
Sara is asked to create a controller for light sensors. When the light falls on the sensor, it needs to indicate when a particul
Marrrta [24]

Answer:

Arduino

Explanation:

<em>Arduino is a free and open-source electronics platform with simple hardware and software. Arduino boards can read inputs, turn on a sensor and transform it into an output, activate a motor, and turn on an LED. Sara may direct her board by sending a series of instructions to the board's microcontroller. To accomplish so, she used the Arduino programming language and the Arduino Software (IDE), both of which are founded on Processing.</em>

7 0
2 years ago
Which word did alexander graham bell want adopted as a telephone greeting instead of hello.
Alik [6]

Answer:

I believe it was Ahoy.

Explanation:

I could be wrong though.

7 0
2 years ago
Read 2 more answers
PLEASE HELP ASAP!!!!!!!!!! WILL GIVE A BRAINLIEST!!!!!!
sattari [20]
The answer to this question is:

"Both work with computers, but only Bluetooth can be used in a headset"

The answer to this is true because Both computers can use/work with computer but Bluetooth can only connect to head set headset don't need wifi it needs Bluetooth and charging/plug

Your Welcome :)
5 0
3 years ago
Read 2 more answers
A medium-sized highway construction company CST has chosen to constrain its investment in computing resources to laptop and desk
Valentin [98]

Answer:

The service model employed for the data storage capability of only CST is:

SaaS (Software as a Service).

Explanation:

The three cloud computing categories are Infrastructure as a Service (IaaS), Software as a Service (SaaS), and Platform as a Service (PaaS).  The three cloud computing services provide different virtual computing resources.  In the case of CST, it utilizes only the data storage software of a provider, who provides the data storage infrastructure, including cloud-based servers, while CST uses its own "laptop and desktop computers and other networking hardware and software to access the Internet efficiently."

5 0
2 years ago
Other questions:
  • What can be determined from this selection? Check all that apply. The Tax Info worksheet is currently being viewed. There are th
    6·2 answers
  • Which mitigation technique would prevent rogue servers from providing false ip configuration parameters to clients?
    5·2 answers
  • What is not a safety practice for working near power lines?
    5·1 answer
  • Lotus 1-2-3 allows the user to record, compare, and organize data. It is often used for creating budgets, tracking sales, and ma
    7·1 answer
  • A group of computers that are interconnected in order to share information or documents is called a _____.
    7·1 answer
  • Why do some people think the global<br> economy is good for the United States?
    10·1 answer
  • What is thhe name of service included with windows server operating systemthat manages a centralized database containing user ac
    5·1 answer
  • Which of the following accurately describes one way that individual goods
    11·1 answer
  • If an electric circuit has 30ohms and 10amps. How many volts the battery voltmeter should read?
    10·1 answer
  • The way of placing text between the margins of a place is called ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!