K_1 is hitting the 1 key on the keyboard, I don't know if it is possible to put a variable into the actual pygame.K_ parameter. if I could figure out a way to add a variable to this I could condense my code down a lot because I am using this type of repetition on multiple occasions. I am making sudoku for anyone who is wondering
keys = pygame.key.get_pressed()
if keys[pygame.K_1]:
numList[cell_num] = "1"
if keys[pygame.K_2]:
numList[cell_num] = "2"
if keys[pygame.K_3]:
numList[cell_num] = "3"
if keys[pygame.K_4]:
numList[cell_num] = "4"
if keys[pygame.K_5]:
numList[cell_num] = "5"
if keys[pygame.K_6]:
numList[cell_num] = "6"
if keys[pygame.K_7]:
numList[cell_num] = "7"
if keys[pygame.K_8]:
numList[cell_num] = "8"
if keys[pygame.K_9]:
numList[cell_num] = "9"
