Question: Please help me solve this python question. Please use basic python and not advanced python. In main.py, write `from pokemon import Pokemon`. Fill a list

Please help me solve this python question. Please use basic python and not advanced python.

In main.py, write `from pokemon import Pokemon`.

Fill a list `pokemon_list` with 5 Pokemon objects: in a loop, randomly choose a row from the dataframe (suggestion: use the dataframe's [sample](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sample.html?highlight=sample#pandas.DataFrame.sample) method to get a dataframe with a single random row, then call [reset_index](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.reset_index.html?highlight=reset_index#pandas.DataFrame.reset_index) so the row index is 0). With values from the relevant columns in the sampled row, instantiate a Pokemon object and add the object to the `pokemon_list`.

Select the first two Pokemon from your list, and have them battle! In a loop, call the method `defend` on `pokemon_list[0]` passing as argument `pokemon_list[1]` and print the result of the combat (you can be dramatic!). Then alternate and let `pokemon_list[1]` defend against `pokemon_list[0]`. Continue the loop until one of the Pokemon has 0 or less HP points. Print the name of the winner and the loser...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!