Question

You are making a really un-fun game of "pocket monster battles." Users are asked to input...

You are making a really un-fun game of "pocket monster battles." Users are asked to input the name and power level of two monsters, and their power levels. The monster with the greater power level wins. You declare who the winner of their battle is.

If one monster is at least twice as powerful as the other, you state that monster is "super efficacious!"

linux3[9]% python3 hw2_part3.py

What is the name of the first monster? ​Squatle

What is the power level of the first monster? ​320

what is the name of the second monster? ​Turnipsaur

What is the power level of the second monster? ​300

Squatle wins!

linux3[10]% python3 hw2_part3.py

What is the name of the first monster? ​Burnmander

What is the power level of the first monster? ​9001

what is the name of the second monster? ​Pikachomp

What is the power level of the second monster? ​9002

Pikachomp wins!

linux3[11]% python3 hw2_part3.py

What is the name of the first monster? ​VeeEee

What is the power level of the first monster? ​4

what is the name of the second monster? ​Meowmathor

What is the power level of the second monster? ​4

It's a draw!

linux3[11]% python3 hw2_part3.py

What is the name of the first monster? ​Evennish

What is the power level of the first monster? ​20

what is the name of the second monster? ​Nohtyp

What is the power level of the second monster? ​50

Nohtyp wins!

Nohtyp was super efficacious!

Homework Answers

Answer #1
n1 = input('What is the name of the first monster? ​')
p1 = int(input('What is the power level of the first monster? ​'))
n2 = input('What is the name of the second monster? ​')
p2 = int(input('What is the power level of the second monster? ​'))
if p1 == p2:
    print("It's a draw!")
elif p1 < p2:
    print(n2, 'wins!')
    if 2*p1 <= p2:
        print(n2, "was super efficacious!")
elif p1 > p2:
    print(n1, 'wins!')
    if p1 >= 2*p2:
        print(n1, "was super efficacious!")

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
What role could the governance of ethics have played if it had been in existence in...
What role could the governance of ethics have played if it had been in existence in the organization? Assess the leadership of Enron from an ethical perspective. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies, collapsed in 2001 under a mountain of debt...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events that took place at Enron and how the situation could have been dealt with differently to prevent further damage? THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT