for practicewrite programs to do the following tasks chess dictionary validator in this we used the dictionary value {' ''bking'' ''wqueen'' ''bbishop'' ''bqueen'' ''wking'to represent chess board write function named isvalidchessboard(that takes dictionary argument and returns true or false depending on if the board is valid valid board will have exactly one black king and exactly one white king each player can only have at most piecesat most pawnsand all pieces must be on valid space from ' ato ' 'that isa piece can' be on space ' zthe piece names begin with either 'wor 'bto represent white or blackfollowed by 'pawn''knight''bishop''rook''queen'or 'kingthis function should detect when bug has resulted in an improper chess board fantasy game inventory you are creating fantasy video game the data structure to model the player' inventory will be dictionary where the keys are string values describing the item in the inventory and the value is an integer value detailing how many of that item the player has for examplethe dictionary value {'rope' 'torch' 'gold coin' 'dagger' 'arrow' means the player has rope torches gold coinsand so on write function named displayinventory(that would take any possible "inventoryand display it like the followinginventory arrow gold coin rope torch dagger total number of items hintyou can use for loop to loop through all the keys in dictionary inventory py stuff {'rope' 'torch' 'gold coin' 'dagger' 'arrow' def displayinventory(inventory)print("inventory:"item_total for kv in inventory items()fill this part in print("total number of itemsstr(item_total)displayinventory(stuffdictionaries and structuring data