-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathChapter 1_Python quiz.py
More file actions
132 lines (75 loc) · 2.38 KB
/
Copy pathChapter 1_Python quiz.py
File metadata and controls
132 lines (75 loc) · 2.38 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
1.Question 1
When Python is running in the interactive mode and displaying the chevron prompt (>>>) - what question is Python asking you?
<A> What would you like to do?
<B> What Python script would you like me to run?
<C> What is your favourite color?
<D> What is the next machine language instruction to run?
AnS: <B> What Python statement would you like me to run?
1.Question 2
What will the following program print out:
>>> x = 15
>>> x = x + 5
>>> print(x)
<A> 20
<B> 5
<C> 15
<D> "print x"
<E> x + 5
Ans: <A> 20
3.Question 3
Python scripts (files) have names that end with:
<A> .png
<B> .exe
<C> .doc
<D> .py
Ans: <D> .py
4.Question 4
Which of these words are reserved words in Python ?
<A> if
<B> concat
<C> break
<D> todo
<E> machine
AnS: <A> if
5.Question 5
What is the proper way to say “good-bye” to Python?
<A> while
<B> #EXIT
<C> quit()
<D> // stop
AnS: <C> quit()
6.Question 6
Which of the parts of a computer actually executes the program instructions?
<A> Input/Output Devices
<B> Central Processing Unit
<C> Main Memory
<D> Secondary Memory
Ans: <B> Central Processing Unit
7.Question 7
What is "code" in the context of this course?
<A> A set of rules that govern the style of programs
<B> A password we use to unlock Python features
<C> A way to encrypt data during World War II
<D> A sequence of instructions in a programming language
AnS: <D> A sequence of instructions in a programming language
8.Question 8
A USB memory stick is an example of which of the following components of computer architecture?
<A> Secondary Memory
<B> Output Device
<C> Main Memory
<D> Central Processing Unit
AnS: <A> Secondary Memory
9.Question 9
What is the best way to think about a "Syntax Error" while programming?
<A> The computer has used GPS to find your location and hates everyone from your town
<B> The computer is overheating and just wants you to stop to let it cool down
<C> The computer needs to have its software upgraded
<D> The computer did not understand the statement that you entered
AnS:<D> The computer did not understand the statement that you entered
10.Question 10
Which of the following is not one of the programming patterns covered in Chapter 1?
<A> Repeated Steps
<B> Conditional Steps
<C> Sequential Steps
<D> Random steps
AnS: <D> Random Steps