Question: PYTHON: The Vacuuminator needs to figure out how far it needs to travel to reach the nearest wall. Write a function distance _ to _
PYTHON: The Vacuuminator needs to figure out how far it needs to travel to reach the nearest wall.
Write a function distancetowallworld This function should return an integer representing the smallest number of moves the Vacuuminator can make before hitting a wall.
If there are no walls present in the world, your function should return None.
Hint: Think about how you can calculate the number of moves the Vacuuminator can make before hitting a wall by using the number of rows and columns between the Vacuuminator and the wall. Also see the lecture recording on for some more guidance if you are having trouble. distancetowallDWXE
distancetowallWEXE
distancetowallDDDDWWDEWEEDEX
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
