December 2018
Intermediate to advanced
226 pages
4h 57m
English
As network automation/DevOps engineers, we often tend to overlook the way we write a script. The focus is always on providing accurate results, which is great, but as we scale our script or application, a focus on the readability of the script is essential.
This becomes a key requirement when we start to work as a team where we have multiple contributors for a script or set of scripts.
Let's look at an example of a bad Python script that returns the result as expected (output is correct):
x=input("What is your name:") print ("how are you"+x) y="how are you"+x if ("test1" in y) and ("test2" in y): print ("cool") x=y.split(" ") x=x[2]+"awesome" if ("are" in x): print ("not cool")
After the second or third line of code as ...
Read now
Unlock full access