Assume you have a non-empty list of scores Q for your math class. Calculate the maximum of the scores.
Use: variables, loops[3]
|
|
|
Test Using: Q = [10] Q = [1,2,3,4,5] Q = [95,9,10] |
A list contains a series of attacks on an enemy. The list looks like [1,2,3,1,1,2,...] where each element in the list is a number that means a type of attack:
1 is a light attack, taking 1HP 2 is a medium attack taking 4HP 3 is a strong attack taking 18HP
Write code to calculate the total amount of HP damage caused by all the attacks.
Use: variables, loops, if[3]
|
|
|
Test Using: attacks = [1,2,3] attacks = [1,2,3,3,2,1] attacks = [69,77,33] |