So maybe you can either add a second run or adjust line 16 to show what happens when
"target" are not the same, which is the expected behavior. Yeah, that’s a good point.
Let’s do two runs. Let’s do the first one that doesn’t fail and then a second one that does fail. So Run 2, we want to use—maybe I’m going to change this to
invalid_input here …
"target" are the same, so the error is going to get thrown. And here I have some
valid_input for the first run, where
So they’re not the same. So in this case we will see
"Done" printed out, and then for the second run, we’re not going to see that. So should I—I should probably give us some indicator that … which run is happening.
Okay, so with the two
print() statements before that, we will see in terminal where we are in the code. Exactly. And then I guess I don’t need these comments anymore.
01:16 Keep it small. Okay, so let’s try that out. Let me clear it first.
There you go. So we have the first run, that works as expected.
"target" are not the same, no error gets raised, and
main() continues past the validation function and prints
"Done" that’s here written in line 10, and then starts the second run. In line 20, we print
And then because
"target" are the same—they’re both
0 as defined in line 21—the
SourceEqualsTargetError gets raised.
01:56 Perfect. I think at this point, I would be relatively happy with the code.
Become a Member to join the conversation.