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]
2 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]2 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
You give an object a more meaningful name by setting the object’s _________________ property.
viva [34]

Answer:

The correct answer to this question is "Name".

Explanation:

In the programming language, the object is a part of the object-oriented programming language (oops).In all (oops) programming language we use class and object. where class is a collection of data member and member function, and object is a real-world entity. An Object is an instance of a Class. When a class is created, no memory is assigned but when we create the object of the class then memory is allocated.

In this question except option (d), all options are wrong.

7 0
2 years ago
Write a program to solve the selection problem. Let k = N/2. Draw a table showing the running time of your program for various v
Brums [2.3K]
So here is the code in Python:

n = 0.00 #this is a float because there are some numbers that are decimals.

while n < 20: #n which is 0.00 and while it is lower than 20 if runs the code below
n = n + 1 #it will add 1 to n everything it runs the code.
k = n / 2 #it will divide whatever n is everytime by 2
print(str(n) + '/2: ') # it's printing the number it's on
print(k) # prints the answer for the n.

You can change n to add by any, make n any num instead of 0.00 and you can change the while condition from n < 20 to any other logical statement. If you want to get creative you can take 2 inputs for numbers and make one of them the starting number and other one is the ending number. Also make sure to make n a number lower than you starting point because if you set n as your starting point then it will skip it.

4 0
2 years ago
A Google Doc automatically moves text to the next line when it reaches the right edge of the screen, is called:
DanielleElmas [232]
Word Wrap

As the name allows, the word wraps around the document once it reaches the border, thus making it the answer.

Hope this helps!
4 0
3 years ago
Read 2 more answers
When introducing a database into an organization, the database approach creates a more controlled and structured information flo
Karolina [17]

Answer:

a.cultural

Explanation:

Cultural impact generally refers to resistance to change in DBMS.It msu be assessed carefully. The Database management system is likely to have effect on functions,people and interactions.For example:- New roles might be given to already existing persons,new people might be hired.

8 0
3 years ago
Telecommunications and software development are examples of information technology careers.
9966 [12]

Answer:

True

Explanation:

Information technology may be described as the use of systems to aid application designs capable of sending and receiving information and building a communication pathway for individuals and companies. It also involves retrieving, storing large chunks of information and organizational data usually in databases to fast track the seamless functioning of the organization's system. The information technology ecosystem is very broad from those charged with ensuring effective communication such as telecommunications platforms and those who build and develop technologies for effective communication and data storage. Hence, both Telecommunications and software development are examples of information technology careers.

5 0
3 years ago
Other questions:
  • What is the exact number of bits in a memory that contains (a) 128k bits?
    9·1 answer
  • Ryan is working on the layout of his web page. He needs to figure out where the title, links, text, and images should go. Which
    15·2 answers
  • Test if a number grade is an A (greater than or equal to 90). If so, print "Great!". Sample Run Enter a Number: 98 Sample Output
    7·1 answer
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • And then what happened,Paul Revere rhyme
    14·2 answers
  • What are the three control statements in Qbasic?​
    10·1 answer
  • how to create use an array of Course objects instead of individual objects like course 1, course 2, etc
    11·1 answer
  • How is knowing how to use word or docs importamt?
    8·1 answer
  • What is software? Why is it needed?​
    6·1 answer
  • The cathode ray tube eventually was eventually used for what entertainment device?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!