Learning Python

Know that there are two major Python versions,  2.7 and 3.  Version 2.7 has a huge following that doesn’t seem to be going away.  I’ve read many sources that say learn on 3 but you might be in an environment that’s 2.7 heavy.  So I say use the one that you’re required at work but learn both.

 

 

How to use exit a program

‘sys.exit(s)’ is just shorthand for ‘raise SystemExit(s)’

#python

>>>raise SystemExit(‘RafError’)

# echo $?

1

#python

>> Ctrl+d

# echo $?

0