Exercise 1.1 What is the function of the secondary memory in a computer?
- Execute all of the computation and logic of the program
- Retrieve web pages over the Internet
- Store information for the long term - even beyond a power cycle
- Take input from the user
Exercise 1.2 What is a program?
Exercise 1.3 What is is the difference between a compiler and an interpreter?
Exercise 1.4 Which of the following contains ”machine code”?
- The Python interpreter
- The keyboard
- Python source file
- A word processing document
Exercise 1.5 What is wrong with the following code:
>>> primt 'Hello world!' File "<stdin>", line 1 primt 'Hello world!' ˆSyntaxError: invalid syntax>>>
Exercise 1.6 Where in the computer is a variable such as ”X” stored after the following Python line finishes?
x = 123
- Central processing unit
- Main Memory
- Secondary Memory
- Input Devices
- Output Devices
Exercise 1.7 What will the following program print out:
x = 43x = x + 1print x
- x + 1
- Error because x = x + 1 is not possible mathematically
Exercise 1.8 Explain each of the following using an example of a human capability: (1) Central processing unit, (2) Main Memory, (3) Secondary Memory, (4) Input Device, and (5) Output Device. For example, ”What is the human equivalent to a Central Processing Unit”?
Exercise 1.9 How do you fix a ”Syntax Error”?