<< Click to Display Table of Contents >>
Navigation: AutoTRAX PCB Design Express (DEX) > Appendix > Scripting > Python > Control Statement >
The If Statement
The if, else, and elif statements control conditional code execution.The general format of a conditional statement is as follows:
print 'The design is a project'
print 'The design is a part
print 'The design is an artwork file'
print 'The design type is unknown'
There can be zero or more elif parts, and the else part is optional. The keyword ‘elif‘ is short for ‘else if’, and is useful to avoid excessive indentation.
An if ... elif ... elif ... sequence is a substitute for the switch or case statements found in other languages.