elif (event key =k_q)rotate the other direction fallingpiece['rotation'(fallingpiece['rotation' len(shapes[fallingpiece['shape']] if not isvalidposition(boardfallingpiece) fallingpiece['rotation'(fallingpiece['rotation' len(shapes[fallingpiece['shape']]lines to do the same thing to except they handle the case where the player has pressed the key which rotates the piece in the opposite direction in this casewe subtract from fallingpiece['rotation'(which is done on line instead of adding making the block fall faster with the down key elif (event key =k_down or event key =k_s)movingdown true if isvalidposition(boardfallingpieceadjy= )fallingpiece[' '+ lastmovedowntime time time(if the down arrow or key is pressed downthen the player wants the piece to fall faster than normal line moves the piece down one space on the board (but only if it is valid spacethe movingdown variable is set to true and lastmovedowntime is reset to the current time these variables will be checked later so that the piece keeps falling at the faster rate as long as the down arrow or key is held down finding the bottom adjy= ) move the current block all the way down elif event key =k_spacemovingdown false movingleft false movingright false for in range( boardheight)if not isvalidposition(boardfallingpiecebreak fallingpiece[' '+ when the player presses the space key the falling piece will immediately drop down as far as it can go on the board and land the program first needs to find out how many spaces the piece can move until it lands lines to will set all the moving variables to false (which makes the code in later parts of the programming think that the user has let up on any arrow keys that were held downthis is email questions to the authoral@inventwithpython com