-
Notifications
You must be signed in to change notification settings - Fork 242
/
wk1 - quiz.py
104 lines (75 loc) · 2.08 KB
/
wk1 - quiz.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Question 1
When Python is running in the interactive mode and displaying the chevron prompt (>>>) -
what question is Python asking you?
What Python statement would you like me to run?
What is the air-speed velocity of an unladen swallow?
What is the next machine language instruction to run?
What Python script would you like me to run?
Answer: What Python statement would you like me to run?
Question 2
What will the following program print out:
>>> x = 15
>>> x = x + 5
>>> print(x)
15
20
x + 5
"print x"
5
Answer: 20
Question 3
Python scripts (files) have names that end with:
.png
.exe
.py
.doc
Answer: .py
Question 4
Which of these words is a reserved word in Python ?
copy
if
make
names
Answer: if
Question 5
What is the proper way to say “good-bye” to Python?
while
quit()
#EXIT
// stop
Answer: quit()
Question 6
Which of the parts of a computer actually execute the program instructions?
Central Processing Unit
Main Memory
Secondary Memory
Input/Output Devices
Answer: Central Processing Unit
Question 7
What is "code" in the context of this course?
A password we use to unlock Python features
A set of rules that govern the style of programs
A way to encrypt data during World War II
A sequence of instructions in a programming language
Answer: A sequence of instructions in a programming language
Question 8
A USB memory stick is an example of which of the following components of computer architecture?
Central Processing Unit
Secondary Memory
Output Device
Main Memory
Answer: Secondary Memory
Question 9
What is the best way to think about a "Syntax Error" while programming?
The computer is overheating and just wants you to stop to let it cool down
You will never learn how to program
The computer did not understand the statement that you entered
The computer has used GPS to find your location and hates everyone from your town
Answer: The computer did not understand the statement that you entered
Question 10
Which of the following is not one of the programming patterns covered in Chapter 1?
Random steps
Sequential Steps
Conditional Steps
Repeated Steps
Answer: Random steps