Question: Solve this using python : NOTE: YOU CANNOT USE ANY BUILT - IN FUNCTION EXCEPT len IN PYTHON. [ negative indexing, append is prohibited ]

Solve this using python : NOTE:
YOU CANNOT USE ANY BUILT-IN FUNCTION EXCEPT len IN
PYTHON. [negative indexing, append is prohibited]
You can use the attribute shape of numpy arrays
YOU HAVE TO MENTION SIZE OF ARRAY WHILE INITIALIZATION
YOUR CODE SHOULD WORK FOR ANY VALID INPUTS. [Make
changes to the Sample Inputs and check whether your program works
correctly] Here is the problem : def play_game(arena):
#TO DO
arena=np.array([[0,2,2,0],
[50,1,2,0],
[2,2,2,0],
[1,100,2,0]
])
print_matrix(arena)
play_game(arena)
#This should print
#Points Gained: 6. Your team is out.
print(".....................")
arena=np.array([[0,2,2,0,2],
[1,50,2,1,100],
[2,2,2,0,2],
[0,200,2,0,0]
])
print_matrix(arena)
play_game(arena)
#This should print
#Points Gained: 14. Your team has survived the game.

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 Databases Questions!