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!
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!")
Get Answers For Free
Most questions answered within 1 hours.