June 2018
Intermediate to advanced
294 pages
7h 5m
English
|
Operator |
Description |
Example |
|---|---|---|
|
if |
Makes a decision based on the operands |
if service == 80: print 'HTTP' |
|
if-else |
Takes a different action after an if decision |
if service == 80: print 'HTTP' else: print 'Not HTTP' |
|
if-elif |
Makes multiple sequential decisions |
if service == 80: print 'HTTP' elif service == 443: print 'TLS' else: print 'Not HTTP or TLS' |