Our first Python code file ended up looking like this:
x = input() y = input() x = int(x) y = int(y) print(x * y)
It isn’t anything fancy or challenging.
yand how they are assigned and serve as labels or identifiers to values.
input()since we’re going to be working on the console for a while, we needed to know how to request and store user input.
input()just captures strings and we have to convert it to a number so that we can do other things with it. We did watch the application fail without the
int()conversion first. But just briefly.
print()and how we can present information to the user.
Outside of this specific program, we ran Python REPL and they just typed after me some basic commands. The wow factor for my then 13- and 11-year-old boys was the math that Python could do. I showed them
math.factorial just becuase it can do a lot of math very quickly and very easily spit out a number that fills the computer screen. They liked seeing that and I think that made them want to learn more.