Set the stage:
It’s past bed time. The stalling has commenced. While I wait for the child to brush teeth I open my computer.
It is my fault.
He walks in. Toothbrush in mouth.
“Papa. How do you make the computer do things? Like, how do you make it answer questions?”
Ah, I remember. I was writing up a script the other day and he was asking about this. Because he knows how to play games. He knows how to search the internet.
So, I pull up a terminal, type python and he says, “Yeah! That!”.
Okay, so I know he’s stalling, but He also knows he’s got me.
We start with what a variable is and add up the kids ages. I type their ages and then he types in the command to add them up.
He then takes the keyboard and wants himself to be a bigger number. After he types it and tries to change his brother to a word we see what happens.
I teach him about the up arrow so he can take a few less seconds to type things and also see that only one variable has changed.
We talk about the error message and how strings need to be encapsulated.
He puts the string in quotes but gets a new error.
Not frustrated yet.
This is were I teach him about casting variables as a type. I should have taught him how to figure out a type, but I didn’t think about that until writing this. Oh well, there will be more times.
Seeing how he can concatenate the words he wants to make a silly word. he wants to make the word ‘malvin’
He changes the variables, remembering the quotes.
Ooops. Almost there. What went wrong I ask.
Figured that one out pretty quick.
Bed. That was a good start for the evening.