PYTHON CODING UPDATED ACTUAL QUESTIONS WITH
CORRECT ANSWERS
Question 1.
What Python statement would you like me to run?
ANSWER
(Chapter 1) When Python is running in the interactive mode and displaying the chevron prompt
(>>>) - what question is Python asking you?
Question 2.
20
ANSWER
(Chapter 1) What will the following program print out:
>>> x = 15
>>> x = x + 5
>>> print x
Question 3.
.py
ANSWER
(Chapter 1) Python scripts (files) have names that end with:
Question 4.
for
ANSWER
(Chapter 1) Which of these words is a reserved word in Python ?
Question 5.
quit()
ANSWER
(Chapter 1) What is the proper way to say "good-bye" to Python?
,Question 6.
Central Processing Unit
ANSWER
(Chapter 1) Which of the parts of a computer actually execute the program instructions?
Question 7.
A sequence of instructions in a programming language
ANSWER
(Chapter 1) What is "code" in the context of this course?
Question 8.
Secondary Memory
ANSWER
(Chapter 1) A USB memory stick is an example of which of the following components of
computer architecture?
Question 9.
The computer did not understand the statement that you entered
ANSWER
(Chapter 1) What is the best way to think about a "Syntax Error" while programming?
Question 10.
Random steps
ANSWER
(Chapter 1) Which of the following is not one of the programming patterns covered in Chapter
1?
Question 11.
# This is a test
ANSWER
(Chapter 2) Which of the following is a comment in Python?
,Question 12.
123abc
ANSWER
(Chapter 2) What does the following code print out?
Question 13.
hours
ANSWER
(Chapter 2) Which of the following variables is the "most mnemonic"?
Question 14.
stop
ANSWER
(Chapter 2) Which of the following variables is the "most mnemonic"?
Question 15.
Retrieve the current value for x, add two to it and put the sum back into x
ANSWER
(Chapter 2) What does the following statement do? x = x + 2
Question 16.
Parenthesis ()
ANSWER
(Chapter 2) Which of the following elements of a mathematical expression in Python is
evaluated first?
Question 17.
2
ANSWER
(Chapter 2) What is the value of the following expression? 42 % 10
CORRECT ANSWERS
Question 1.
What Python statement would you like me to run?
ANSWER
(Chapter 1) When Python is running in the interactive mode and displaying the chevron prompt
(>>>) - what question is Python asking you?
Question 2.
20
ANSWER
(Chapter 1) What will the following program print out:
>>> x = 15
>>> x = x + 5
>>> print x
Question 3.
.py
ANSWER
(Chapter 1) Python scripts (files) have names that end with:
Question 4.
for
ANSWER
(Chapter 1) Which of these words is a reserved word in Python ?
Question 5.
quit()
ANSWER
(Chapter 1) What is the proper way to say "good-bye" to Python?
,Question 6.
Central Processing Unit
ANSWER
(Chapter 1) Which of the parts of a computer actually execute the program instructions?
Question 7.
A sequence of instructions in a programming language
ANSWER
(Chapter 1) What is "code" in the context of this course?
Question 8.
Secondary Memory
ANSWER
(Chapter 1) A USB memory stick is an example of which of the following components of
computer architecture?
Question 9.
The computer did not understand the statement that you entered
ANSWER
(Chapter 1) What is the best way to think about a "Syntax Error" while programming?
Question 10.
Random steps
ANSWER
(Chapter 1) Which of the following is not one of the programming patterns covered in Chapter
1?
Question 11.
# This is a test
ANSWER
(Chapter 2) Which of the following is a comment in Python?
,Question 12.
123abc
ANSWER
(Chapter 2) What does the following code print out?
Question 13.
hours
ANSWER
(Chapter 2) Which of the following variables is the "most mnemonic"?
Question 14.
stop
ANSWER
(Chapter 2) Which of the following variables is the "most mnemonic"?
Question 15.
Retrieve the current value for x, add two to it and put the sum back into x
ANSWER
(Chapter 2) What does the following statement do? x = x + 2
Question 16.
Parenthesis ()
ANSWER
(Chapter 2) Which of the following elements of a mathematical expression in Python is
evaluated first?
Question 17.
2
ANSWER
(Chapter 2) What is the value of the following expression? 42 % 10