And, what do we see? The operand is twelve.
Interesting, okay, didn't expect that. Let's watt that in.
And let's enter, three and hit Enter. Boy, it's working great.
We've got twelve and three. But I think something's amiss here.
Let's do the following, let's try to add those two.
Ooh, we get 123, this is really getting good.
I'm going to try something more daring. I'm going to multiply them.
Oh, I just blew up. So what happened in there?
Well, I didn't anticipate things going quite this crazy, but I think it's
actually, you'll see kind of what went on. I said Operand is equal to input.
Now what did I tell you input wise? This was a text input.
This wasn't a number input. So input was extreme.
So whenever I said operand is equal to input.
It actual set the operand to be the string one two.
Then I swapped it, it made the store the string one two.
Then I entered three. So it said operand equal to three.
Now at that point I was expecting it to blow up.
I was thinking, oh okay, you know, we do string twelve plus a string three, what
could happen? Well, huh, it concatenated.
It made the string one, two, three. Okay.
Everything was going merrily, and then I said, hm, let's multiply.
So I said, the string one, two, three times the string three.
At that point, things blew up. Didn't know what to do with
multiplication. So, this is like more of a story why you
should do actually a fair bit of debugging, that was unplanned by the way.
I knew it was gonna, we didn't have the right type for the input, but I didn't
realize it's gonna go so far. But I think, we can actually learn more of
a story from this is, which is we wanted a number here, we wanted the operand to be a
number. This is a string, so we can fix this very
easily, all we need to do is to coerse this string into being a number.
So, we have some functions, we know how to do that well.
The function int converts it to an integer.
So, let's say, int of input. And we'll run it again.