Tuesday, September 18, 2012

Reserved words in Python


If you've been experimenting with Python, as I have, then you might notice that some words are saved for some certain processes.  For example lambda is one of these words.  I tried to use it as a variable name.  it will usually highlight in blue if it is important.  So an alternative is to use lamb_da or lamb_duh etc.

Other words include:

and, as, assert, break, class, continue, def, del, elif, else, except, False, finally, for, from, global, if, import, in, is, lambda, None, nonlocal, not, or, pass, raise, return, True, try, with, while,and yield.


Langtangen, H. P. (2012). A Primer on Scientific Programming with Python (3rd ed.). Heidelberg: Springer. doi:10.1007/978-3-642-30293-0

No comments:

Post a Comment