fallingpiece['rotation'(fallingpiece['rotation' len(shapes[fallingpiece['shape']]the up arrow key (or keywill rotate the falling piece to its next rotation all the code has to do is increment the 'rotationkey' value in the fallingpiece dictionary by howeverif incrementing the 'rotationkey' value makes it larger than the total number of rotationsthen --modding|by the total number of possible rotations for that shape (which is what len(shapes[fallingpiece['shape']]isthen it will --roll over|to here' an example of this modding with the shapewhich has possible rotations if not isvalidposition(boardfallingpiece) fallingpiece['rotation'(fallingpiece['rotation' len(shapes[fallingpiece['shape']]if the new rotated position is not valid because it overlaps some boxes already on the boardthen we want to switch it back to the original rotation by subtracting from fallingpiece['rotation'we can also mod it by len(shapes[fallingpiece['shape']]so that if the new value is - the modding will change it back to the last rotation in the list here' an example of modding negative number-