COMPSCI 61A Lecture Notes - Lecture 2: 2

94 views3 pages
6 Dec 2016
School
Professor
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

Names, assignment, and user-de ned functions from math import pi // import things you need from python"s built-in values area, circ = pi * radius ** (cid:617), (cid:617) * pi * radius // assign multiple values built-in functions (ex max(cid:383)(cid:384) ) can be reassigned to variables. >>> f(cid:383)(cid:617), (cid:619)(cid:384) (cid:619) don"t assign built-in function names to other values if you do, then do builtins. max to x it. Environment diagrams environment diagrams visualize the (python) interpreter"s process. Code (left): statements and expressions arrows indicate evaluation order (green: just executed; red: next to execute) Frames (right): each name is bound to a value within a frame, a name can"t be repeated. Assignment is a simple means of abstraction that binds names to values. Function de nition is a more powerful means of abstraction: binds names to expressions def (cid:383)(cid:384): return Function signature indicates how many arguments a function takes.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents