Join us and get access to thousands of tutorials and a community of expert Pythonistas.
This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.
Check if the Code Still Runs the Same
00:00
Because we have this conditional statement here that says if source == target, and now this is much easier to read from from our input here, we see "source" does equal "target" at the moment.
00:10
In line 13, you can see that "source" is 0, and "target" is 0 as well. So this conditional is going to evaluate to True, and the error is going to get raised.
00:19 And let’s confirm that too.
00:25
If I run this example, then you can see that the AssertionError gets thrown just as it did before.
00:31 And that’s also helpful when you’re refactoring your code, to every once in a while also run the example to see that you’re not changing anything and see that it still works as before.
00:39 There’s better ways to do this, but we’ll talk about this in a bit.
Become a Member to join the conversation.