Memory in Python - Cornell University
Lecture 10
Memory in Python
Announcements For This Lecture
Reading
Assignments
? Reread all of Chapter 3
? Work on your revisions
¡ì Want done by Sunday
? Survey: 487 responded
¡ì Remaining do by tomorrow
¡ì Avg Time: 7.0 hours
¡ì STD Dev: 4.9 hours
? Assignment 2 also Sunday
¡ì Scan and submit online
? Assignment 3 up Monday
9/22/16
Memory in Python
2
Modeling Storage in Python
? Global Space
¡ì
¡ì
¡ì
¡ì
Global Space
What you ¡°start with¡±
Stores global variables
Also modules & functions!
Lasts until you quit Python
p
Call Frame
incr_x
? Call Frame
q
¡ì Variables in function call
¡ì Deleted when call done
id2
Heap Space
id2
? Heap Space
¡ì Where ¡°folders¡± are stored
¡ì Have to access indirectly
9/22/16
id2
Memory in Python
Point3
x
1.0
y
2.0
x
3.0
3
Memory and the Python Tutor
Heap
Space
Global
Space
Call Frame
9/22/16
Memory in Python
4
Functions and Global Space
? A function definition¡
def to_centigrade(x):
¡ì Creates a global variable
(same name as function)
return 5*(x-32)/9.0
¡ì Creates a folder for body
Global Space
Body
to_centigrade id6
¡ì Puts folder id in variable
? Variable vs. Call
Heap Space
>>> to_centigrade
id6
function
>>> to_centigrade (32)
Body
0.0
9/22/16
Memory in Python
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- title clear — clear memory
- memory in python cornell university
- python activity 2 input and variables in python ioct
- what is a variable in python variable naming rules in python
- memory saving tips for circuitpython adafruit industries
- python v3 stack frame examples swarthmore college
- ppyytthhoonn vvaarriiaabbllee ttyyppeess
- python variable types picone press
- c4m the python memory model
- dude where s my ram a deep dive into how python uses memory
Related searches
- cornell university data analytics program
- cornell university data analytics certificate
- cornell university business analytics
- cornell university business
- cornell university johnson business school
- cornell university college of business
- cornell university college report
- cornell university reputation
- cornell university data analytics
- cornell university dyson business school
- cornell university johnson
- cornell university johnson school