I'm doing an easy program in python where I have my turtle and can go around and it draws but I want to make it so that when I press shift the .pensize(x) goes up by one and when I press control it goes down by one but I don't know how to do it.
Code:
def pensizeUp():
x = 0
x += 1
k.pensize(x)
def pensizeDown():
x = 0
x -= 1
k.pensize(x)
wn.onkeypress(pensizeUp, "Shift_L")
wn.onkeypress(pensizeDown, "Control_l")
I tried searching it up but I couldn't find out how to do it. I also tried different things but in the end I wasn't able to figure it out.