Last login: Wed Dec 9 11:20:22 on ttys001 hayness-MacBook-Air:~ haynes$ python Python 2.7.6 (default, Sep 9 2014, 15:04:36) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> x Traceback (most recent call last): File "", line 1, in NameError: name 'x' is not defined >>> 3 3 >>> 3 + 15 18 >>> x + 22 Traceback (most recent call last): File "", line 1, in NameError: name 'x' is not defined >>> x = 22 >>> x 22 >>> x = x * 2 >>> _ 22 >>> x 44 >>> dir() ['__builtins__', '__doc__', '__name__', '__package__', 'x'] >>> help(dir) >>> help(__builtins__) >>> help(max) >>> help(if) File "", line 1 help(if) ^ SyntaxError: invalid syntax >>> help Type help() for interactive help, or help(object) for help about object. >>> help() Welcome to Python 2.7! This is the online help utility. If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://docs.python.org/2.7/tutorial/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". help> q You are now leaving help and returning to the Python interpreter. If you want to ask for help on a particular object directly from the interpreter, you can type "help(object)". Executing "help('string')" has the same effect as typing a particular string at the help> prompt. >>> >>> range(1, 10, 3) [1, 4, 7] >>> range(1, 10, 2) [1, 3, 5, 7, 9] >>> range(1 10) File "", line 1 range(1 10) ^ SyntaxError: invalid syntax >>> range(1, 10) [1, 2, 3, 4, 5, 6, 7, 8, 9] >>> for i in range(1, 10) File "", line 1 for i in range(1, 10) ^ SyntaxError: invalid syntax >>> for i in range(1, 10): ... x = 2 * i ... print i, x ... 1 2 2 4 3 6 4 8 5 10 6 12 7 14 8 16 9 18 >>> for i in range(1, 10, 2) File "", line 1 for i in range(1, 10, 2) ^ SyntaxError: invalid syntax >>> for i in range(1, 10, 2): ... if i == 3: ... print "boom" ... else: ... print i ... 1 boom 5 7 9 >>> quit Use quit() or Ctrl-D (i.e. EOF) to exit >>> quit() hayness-MacBook-Air:~ haynes$ hayness-MacBook-Air:~ haynes$