Assume you have 2 lists of numbers that are the same size: VAR and Y. Count how many times an element in VAR is bigger than the element in the same position in Y.
Use: variables, loops[2]
|
|
|
Test Using: VAR = [5], Y = [5] VAR = [1,2,3], Y = [3,2,1] VAR = [88,65,13], Y = [83,70,35] |
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 3HP 2 is a medium attack taking 4HP 3 is a strong attack taking 15HP
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 = [11,42,47] |