Write a function that takes the name of a chess piece and its position, and retu

Write a function that takes the name of a chess piece and its position, and returns all the squares that piece can reach after a single move is made.
Assume there are no other pieces on the board. Name the function position(…), it takes two arguments, the piece name and its position (both parameters are strings).
def position ( piece , loc ) :
The function should return a list; the order of the squares in the list does not matter. Valid piece names and a descriiption of how they move are shown in the Table 1.
DO NOT USE AI ! Please make sure the code works correctly and there are no mistakes. We use Python version 3.11.

Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount