Variable Declarations

Variable Declarations#

Let’s use what we’ve learned so far to declare a variable according to a specification we give you.

We’re in a workspace. At the top right, a Python program in the file declares the two variables num_profs and num_tas.

Add a new declaration for a variable named num_students, with value equal to 45. Click the Mark button to check your work; you can do it as many times as you like.

A few tips about using Ed to run your program:

  • For the first few programs we’ll test out, you don’t need to worry about providing input and output, or what stdin and stdout are. We’re just testing out that the program you write follows the directions.

  • You can submit as many times as you want, and each time you submit, the system will give you some feedback on what you might have done wrong.

  • You can run the program before submitting, and it will show you the output. In many cases, we (the course staff) have controlled how the output appears. In this case, there’s no output at all—we’ll just test that your values are correct.

Above all else, please DOWNLOAD THE CODE so you can refer back to it later, as well as testing it on your own machines using IDLE!