COMPSCI 61A Chapter Notes - Fall 2018 Chapter 1 - Infinite loop, Docstring, Uniform Resource Locator
zogo39484755 and 6 others unlocked
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents
Document Summary
Urlopen: function which can access the content at a uniform resource locator (url) W[::-1] enumerates each letter in a word backwards. Primitive expressions and statements (simplest building blocks) Means of combination (compound elements built from simpler ones) Means of abstraction (compound elements can be named and manipulated as units) If a value has been given a name, we say the name binds to the value. Can assign new names to functions as well (f = max) Memory that keeps track of names, values, and binding is called an environment. To evaluate a call expressions, python will: Evaluate the operator and the operand subexpressions. Pure function: applying them has no effects beyond returning a value. Must always return the same value when called twice with same arguments. Non-pure function: can generate side effects, which make some change to the state of the interpreter or computer. Ex: print returns none, but printing output is side effect of being called.