Welcome to CS 61A! Although we didn’t go over any material in discussion today, I recommend trying to work through the problems below, using lecture and the textbooks as references, to prepare for next week.
- (values, expressions)
- What is a name? Can one object have many names? Can one name refererence many objects?
- What is the difference between a function and a function call?
a + b? What is data type of the value stored in
a + bis
6. The value
3gets assigned to
bin the second statement. The value stored in
"a"which is a string.
The following code is entered into the Python interpreter.
If I call the function
foo with argument
x, what would the return value be?
30is passed in as an argument and is bound to
x. Inside of the function body,
xassigned to the number 50 in the local frame. Variables in the local frame have priority over variables in the global frame, so the value that is returned is