Learning python

there is a bug where this happens
image

whenever I press enter, it stays at the same length. I have to use BACKSPACE to get to

function call() {
   print("aaaa")
}

it stays like that if I use ‘(’,’[’,’{’

is there a way to fix it?