Variables and Values

The questions below are due on Friday June 14, 2024; 10:00:00 PM.
 
You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.

Link to relevant section of reading

Variable Names

Which of the following are valid names for Python variables? Check the boxes next to the names that are valid Python variable names.

Transcript

Consider the following program:
a = 12.1
c = 8.6
a = 1.5
b = 0.6
if a > 6:
    a = b
else:
    a = c

c = b
Walk through the program above step by step using an environment diagram that you draw yourself. Then create an environment diagram using the interface below that shows the state of program memory once all of the instructions above have run:
ℹ️
🗑️
After the code has executed, what are the values of each of the following variables?
Variable a has value:
Variable b has value:
Variable c has value:
Next Exercise: Distances
Back to exercises