Chapter 1 :Programming for Everybody (Getting Started with Python) (Python for Everybody Specialization) Answers 2025
Question 1
When Python is running in interactive mode and displaying >>>, what is it asking you?
β
What would you like to do?
β What is your favourite color?
β What Python script would you like me to run?
β What is the next machine language instruction to run?
π§ Explanation:
The >>> prompt means the Python interpreter is waiting for your next command β itβs asking βWhat would you like to do?β
Question 2
What will the following program print out?
x = 15
x = x + 5
print(x)
β
20
β 5
β 15
β “print x”
β x + 5
π§ Explanation:
The variable x starts at 15, adds 5, becomes 20, and print(x) displays 20.
Question 3
Python scripts (files) have names that end with:
β
.py
β .doc
β .png
β .exe
π§ Explanation:
Python files always use the .py extension (e.g., program.py).
Question 4
Which of these words is a reserved word in Python?
β
for
β names
β pizza
β payroll
π§ Explanation:
Reserved words (keywords) like for, if, while, etc., have special meanings in Python and canβt be used as variable names.
Question 5
What is the proper way to say βgood-byeβ to Python?
β
quit()
β #EXIT
β while
β // stop
π§ Explanation:
You exit the Python interactive shell using quit() or exit().
Question 6
Which part of a computer actually executes the program instructions?
β
Central Processing Unit (CPU)
β Secondary Memory
β Input/Output Devices
β Main Memory
π§ Explanation:
The CPU reads and executes instructions β itβs the βbrainβ of the computer.
Question 7
What is “code” in the context of this course?
β
A sequence of instructions in a programming language
β A set of rules that govern the style of programs
β A password we use to unlock Python features
β A way to encrypt data during World War II
π§ Explanation:
Code means program instructions written in a programming language like Python.
Question 8
A USB memory stick is an example of which computer component?
β
Secondary Memory
β Output Device
β CPU
β Main Memory
π§ Explanation:
USB drives are secondary storage β data is kept even when the computer is off.
Question 9
What is the best way to think about a βSyntax Errorβ?
β
The computer did not understand the statement that you entered
β The computer is overheating
β Needs software upgrade
β Hates everyone from your town π
π§ Explanation:
A syntax error means you typed something Python canβt interpret β itβs a language mistake.
Question 10
Which of the following is NOT one of the programming patterns covered in Chapter 1?
β
Random steps
β Conditional Steps
β Repeated Steps
β Sequential Steps
π§ Explanation:
Basic programming patterns include sequential, conditional, and repeated steps β random steps are not a core pattern.
π§Ύ Summary Table
| Q# | β Correct Answer | Key Concept |
|---|---|---|
| 1 | What would you like to do? | Interactive mode prompt |
| 2 | 20 | Variable reassignment |
| 3 | .py | Python file extension |
| 4 | for | Reserved keyword |
| 5 | quit() | Exit command |
| 6 | CPU | Executes instructions |
| 7 | Sequence of instructions | Meaning of βcodeβ |
| 8 | Secondary Memory | Storage example |
| 9 | Computer didnβt understand statement | Syntax error definition |
| 10 | Random steps | Not a core pattern |