Loving your child's mind: Alana learns Python

Alana is learning Python through Py4E after starting with Juni Learning's game-focused approach. She built a program to multiply two numbers by defining variables and handling input, and notices that logic flows the same across Python and JavaScript, though syntax differs. She connects programming's if-then reasoning to chess strategy, where thinking several moves ahead mirrors how code sequences work.
Chapters
Thanks. So I'm curious about Python. I did not realize that you'd already learned some Python at a, like, summer camp. Is that what your parents said?
Um, sort of. I'm part of this course called Juni Learning, and I've learned— I'm learning Python there. Um, but I'm learning it more, more in a sense of making games and not like, I guess you could call it I mean, the things that we're doing on Py4e.
Got it. So actually, I'm very interested in similarities and differences between Python for Everybody and what you're doing. So first, how is Python for Everybody different from what you were already doing?
Well, what's different is that I did start at the very beginning again, just as a good review. And I mean, I'm going to be using the command prompt on my computer. And with Junie, I haven't done that yet. It's just on the editor. And I think I will be learning new things on Py4E because, as I just said, on Junie, I'm more focused on creating games, I guess.
How many lessons into Py4E are you?
I'm not on number 3 because there are multiple videos and quizzes in each lesson.
Got it.
Yeah, I'm on number 3 of I don't know how many.
Okay, so I looked at the first few, first 2 videos of lesson 2, installing it. I skipped lesson 1 because it was just installing Python. So I have a sense for this guy. What do you think of this guy's videos, the Python Free App guy's videos? Helpful, not helpful? What are they like?
I think it's very helpful. I haven't really watched or— yeah, watched anything like it before. I think his teaching style is very effective toward me, and I'm enjoying it.
Got it. And what makes— in what way have you said you've never seen anything like it? Is it— how is it different from things you've seen before?
Well, one, usually I'm in person and not just watching assigned videos. Coding anyways. And he's using these, I don't like these charts, whereas usually when I'm learning my games, my teacher explains to me with annotation because we use Zoom like we are now.
Yeah, got it. And then lesson 3 is when you get into coding in Python for Everybody. Are the first coding lessons in Lesson 3 pretty easy for you?
I'd say most of them, but there was one that it took us a while, or maybe like a day, like a day and a half to figure out just with the time we had. But I think it was nice because it stretched my brain because I knew I already know some things and I tried to was into the answer and it didn't work, and then it worked this time.
Got it. And you say us— who is the us that was working on it together?
Uh, my class, uh, my teacher and I.
Are you referring to Zolake?
Yes. Got it. I do not want to mispronounce his name.
Okay, no problem. Um, there were other students. I know there was Colette. Isn't Colette your age?
Ah, yes, I think.
Did you Did you and Colette work together at all?
Yes, we did.
Would you say—
She wasn't there Friday.
Got it.
But she didn't get to see the answer.
Would you say she's about the same level that you're at in Python?
I think so, because the things that I'm learning on Py4e is different, and I'm learning newer things.
Got it. And so tell me about the hard problem. What was the hard problem and what— How did you figure it out?
We had to make a program, a really small program that multiplied two variables into another one. And I guess it was just the placing of things that I didn't— that we didn't understand. And so once we finally— yeah, once we tried a few things, We kind of got an idea of how we could solve it, and then we did it.
Got it. And then was the concept of a variable in an equation new for you, or you'd already seen variables in equations?
I had already seen that type of stuff.
Do you know where? Was it in math or in your other Python class or somewhere else?
It was in my other Python class because I do have to use that sometimes.
Got it. Now, what's interesting is that, um, often students don't get to variables in mathematics until they get to algebra, which is usually later. And I've often thought that programming is a better way to learn about variables because you can see it. I assume that once you solved your program, you plugged some numbers in it and saw it work?
Yes.
How many digits did it multiply? Were these just single digits or more than one digit?
It was more than one digit. 35 times 2.75, I think.
Got it. And then did you check it out on a calculator or did you do it by hand? How did you know it got the right answer?
There was an example of the desired output you needed to get in order— or yeah, you needed to get, and then you just had to match your output to theirs.
But I would expect you probably tried some different things that were not part of the regular, of the examples. Did you guys try some other numbers?
No, we didn't.
Do you see why I would think you would want to try other numbers?
Yes, I think so.
So with respect to what, how would you describe programming to somebody else? So suppose you, somebody you didn't know who had never coded, done any program at all, said, hey, Ilana, I hear you're learning to program in Python. What are you doing? How would you explain it to them?
Well, I think I would say that all we're doing is just making a series of instructions and telling it to the computer, but in their language so that the computer can understand it.
Do you think that the, I don't know, average kid on the playground would understood what you meant by that?
Well, if that average kid could program, possibly.
That's cheating, of course. Suppose they'd never done anything like it at all.
I think it's pretty simple in that way to understand. You're making, telling the computer what to do, but you have to make sure that they understand.
Um, do you know what I mean by— if I say computer syntax, do you know what I mean?
I think so.
How about computer logic, or the logic of a program?
Ah, as in the word placement or the code placement, or—
well, that's what I'm getting at. Um, I think of two aspects that can be challenging. One is the logical flow of a program, and then the other is the syntax. Of Python in particular. And do you know what I mean by that distinction? The kind of overall logical flow of the program versus the Python syntax?
I think I know what you mean.
You want to give me your version to explain the two?
Um, like the order of which the code goes, maybe just how you write it.
Are you saying that's the first one?
Uh, the logic.
In which case, what would the syntax be? What would I mean by Python syntax?
I think what you mean by Python syntax is like the actual code and the text and the case sensitivity.
Excellent. No, that's exactly right. And I would say one, often when people are beginning to learn to code, you know, you kind of struggle with the syntax because you do, as the guy said, computers are stupid and very literal. And so you do need to learn how exactly Python needs to be expressed. As you say, it's right down to case sensitivity and where, you know, brackets go and things like that. Whereas the logical flow, right, that's the kind of overall, you know, sequence, how you design the sequence of instructions. Would you say that when you were working on that multiplying two variables, you started by thinking in your head, kind of how, how to make that happen?
I think so, yes, I did that.
What was, what was your kind of conceptual strategy? How did you think about multiplying two variables?
Uh, well, I knew that because there was only one variable given, so I knew that first I had to make the other variable, um, make it so that it has input or needs inputs of the So the person has to enter something. And then I knew that if you wanted to print something out, but yeah, if you wanted to print the answer out, you needed to multiply the two variables. So you'd probably put that after the actual words in the text. Got it. Yeah.
And do you see how that kind of logical flow is different from the syntax, the detailed how you actually write the Python?
Yes.
And one reason I like that distinction is, have you learned any other computer languages at all, or so far just Python?
I'm actually learning JavaScript currently as well as Python.
Cool.
Where are you learning JavaScript? It's this thing that I'm using for my homeschool. It's called the League of Amazing Programmers.
Got it. Yeah, the case I would make is although JavaScript syntax is different from Python syntax, the idea of logical flow is common in both directions. Would you agree?
I think so, yes.
I mean, I think— do you play chess at all?
I do play chess.
Do you like chess?
I do.
Are you good at chess?
Um, depending on what you call good. I know I've won some, lost some.
Who do you usually play against?
Um, I usually play against my dad or my brother. Um, sometimes if my friends come over or I'm at their house and they have chess, or maybe at school, I play with some of my friends.
Got it. Well, the reason I think of chess, I actually, I actually got a job. My, I got my first job as a software programmer, as a coder, because I was beating this guy in chess all the time. And so he realized that I had a pretty good logical mind. And the reason I think it's similar is in chess, you have to think several steps in advance. You know, if they move their queen there, then I'm going to move my pawn there, and then they'll move their bishop there. You know what I mean by thinking of logical steps?
Yes.
How many steps ahead would you say you're thinking in chess? Do you think one step ahead, or one move ahead, two moves ahead, three moves ahead?
Um, well, I would say that I'm not that advanced, so I would just think of the next move and not two moves in advance.
Do you see why it might be helpful to think two moves in advance?
Yes, I do see.
Yeah, um, I would say that, and, and I would say if you're thinking two moves in advance, it's a bunch of if-then statements. You know, if they move the queen there, then if I move my pawn there, then they'll have to move their bishop there. You know what I mean? It's a bunch of if-then statements. Does that make sense?
Yes.
And I see code is very similar, or the logical structure of code. You know, if I want to multiply these two numbers and I want to put something out, then I need to have, you know, a little bit like what you said. You know what I mean?
Yes.
So I think a lot of becoming good at a lot of things is learning to think logically, to be able to hold those if-then statements in your brain. Do you think that, um, well, first, do you, do you like thinking logically and holding those kind of if-then statements in your brain?
I do, yes.
Okay. Can you think of any other examples other than chess and coding where you hold if-then statements in your brain?
Um, well, I guess I, I could think of jiu-jitsu, actually. Like, if they move like this or put their hand here, then I have this move open to me where I can get, I don't know, a submission.
Absolutely. Um, I— because I don't know jiu-jitsu, I know that in chess, you know, you can think multiple moves in advance. Um, but in jiu-jitsu, can you think multiple moves in advance, or is it so unpredictable after a certain point you can't predict much in advance anymore?
I think that it could be possible because if you know that you have them stuck and you know exactly what they have to do, I guess in that case you could know a few steps ahead.
Actually, what that makes me think of is also in chess, you know, if there are kind of an inf— or not an infinite, but if there are lots of different moves they can make, then it's harder. But when they have fewer moves, then it's actually easier to predict several moves in advance because your brain doesn't have to do as many calculations basically. So what I'm hearing in jiu-jitsu sometimes there are places where their options are limited, so then it— then you can actually think several moves in advance. Is that accurate?
Yes, it is.
Okay. Um, I would say in a lot of games— what other kind of games do you like to play?
Um, games like, like sports, or just—
I was thinking more board games. Board games.
There's checkers. Um, I guess you could say that. I haven't actually played checkers. In a long time. But there are some other board games that my parents and I like to play along with my brother. We had this game called Block Us. Do you know what that is?
I don't.
Okay. It's this game where you have to try block the other people with your pieces. Yeah, it's very fun.
So I don't know that one, but of course I know checkers. Would you say checkers also could be a series of logical statements, of if-then statements?
I think so.
In checkers, I know it's been a while since you played, did you think just one move in advance, or did you think more than one move in advance?
Um, for me personally, or can other people do that?
Either.
Um, well, me personally, I honestly just went along with the game, and I didn't really think ahead.
Got it.
Uh, I think it is possible to think a few steps ahead. Like, if they move here, and I know they'll have to move there if you have them like cornered, then I can do this, and so on.
Do you see why it might be a competitive advantage to learn to think several moves in advance?
I do see.
Yeah, um, we froze. Are you back?
Yes, I think I am.
Okay, you are. Yeah, no, I think it's terrific. So because our connection is getting iffy, um, first, how is class? Is Humanities class still going well?
It is. I love it.
Terrific. What did you read last week?
Uh, Last week, this week, we were finishing reading Taming the Bicycle. We finished that, and then we started talking more about James Turrell, the American artist.
Yeah.
What is— Sorry, go ahead.
What is Taming the Bicycle?
It's a novel, a short novel by Mark Twain. Got it.
And then you said there was one other thing after James Turrell you looked at?
We were looking at the painting Empire of Light by Magritte, I think is how you say her name or his name.
Got it. Well, marvelous. I'm glad class is going well. I expected it was. But yeah, I am going to recommend some other games. Would you say you like board games in general?
I do. Yes.
Yeah, I'm very big on board games to help logical thinking, and I would encourage you to be aware when you're programming and also when you're playing games of increasingly long strings of logical thought. Actually, to give you one more piece, when I was in high school, I had a friend and we had a long bus ride, an hour and a half each direction, and we would play chess on the bus. But this was before magnetic chess sets, and sometimes the chess pieces would all fly away. So we would have to remember the chess pieces, and eventually we got to the point where we could play chess in our heads. Do you think you could play a game of chess in your head?
Uh, not currently. I think I'd have to have a bit more practice.
There we go. But you both have to remember the pieces, but also then you can think, you kind of think logically about if this, then that. But I would encourage you to develop your ability to think in long sequences of logical steps. And then bit by bit, it's a superpower. Makes sense?
Yes. Thank you.
You're welcome. All right. Have a wonderful week. Uh, we see you next week. Bye-bye.
All right.
Bye.










