The console in Godot is output only… it cannot actually interact with you. So any command line interaction will not work. Python is the closest language to GDScript but it is not actually python (which i think you know)
To take text in from the running game, I think you are looking for the LineEdit control.
I would recommend looking at that and then googling for a video tutorial that fits the style of game you are making. At a glance it looks like you would need to determine how to know when to grab the text (either a button OR a signal reacting to the ENTER key or something).
A video would be much more helpful than my attempt here
if Input.is_action_pressed("button"):
Do Something Here
In the project settings, there is an input map. You can set the button to press there and give it a name which you put in the “button” section. So if you go into the project settings, input map and create an input called First_Input and map it to the 2 key then write this code
if Input.is_action_pressed("First_Input"):
num1 = 2
print("Enter a number: ", num1)
you will be able to change the variable with a button press.
Godot is similar to python but there are quite a few differences too. If you want to learn python I suggest downloading a standard IDE like geany for example. Hope this helps.