Summary
This chapter was dedicated to conditional testing and scripting loops. Since we had already discussed the if-then-else
statements, we recapped on this information before going on to showing more advanced uses of the conditional testing toolkit. This advanced information included using regular expressions, which we learned about in the previous chapter, within a conditional testing scenario to allow for more flexible tests. We also showed you how multiple conditions can be tested sequentially, using elif
(short for else if
). We explained how multiple if-then-else
statements can be nested to create advanced logic.
In the second part of this chapter, we introduced the while
loop. We showed you how we can use this to create a script that will run indefinitely, or how we can use conditions to stop the loop when a certain criteria has been met. We presented the until
keyword, which has the same functionality as while
but allows for negative checking instead of positive for while
. We ended...