-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08074-python-exam-samples-en.html
More file actions
455 lines (357 loc) · 19.8 KB
/
08074-python-exam-samples-en.html
File metadata and controls
455 lines (357 loc) · 19.8 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
<!DOCTYPE html>
<html lang="en-US">
<head>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/favicon/site.webmanifest">
<link rel="alternate" type="application/rss+xml" title="RSS Feed for Zhiwei Li"
href="https://lzwjava.github.io/feeds/feed.xml" />
<title>08074 Python Exam Sample Questions</title>
<script defer src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "70fc8c466cc1445098b3fc6f209c22c2"}'>
</script>
<!--
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-66656236-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-66656236-1');
</script>
-->
<meta charset="UTF-8">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>08074 Python Exam Sample Questions | Zhiwei Li</title>
<meta name="generator" content="Jekyll v3.10.0" />
<meta property="og:title" content="08074 Python Exam Sample Questions" />
<meta name="author" content="Zhiwei Li" />
<meta property="og:locale" content="en" />
<meta name="description" content="Question: Provide 50 sample exam questions from past years for the 08074 Advanced Computer Programming exam in the Guangdong National Higher Education Self-study Examination (Computer Science bachelor’s degree)." />
<meta property="og:description" content="Question: Provide 50 sample exam questions from past years for the 08074 Advanced Computer Programming exam in the Guangdong National Higher Education Self-study Examination (Computer Science bachelor’s degree)." />
<link rel="canonical" href="https://lzwjava.github.io/08074-python-exam-samples-en" />
<meta property="og:url" content="https://lzwjava.github.io/08074-python-exam-samples-en" />
<meta property="og:site_name" content="Zhiwei Li" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2026-03-03T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="08074 Python Exam Sample Questions" />
<meta name="twitter:site" content="@lzwjava" />
<meta name="twitter:creator" content="@lzwjava" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"Zhiwei Li"},"dateModified":"2026-03-03T00:00:00+08:00","datePublished":"2026-03-03T00:00:00+08:00","description":"Question: Provide 50 sample exam questions from past years for the 08074 Advanced Computer Programming exam in the Guangdong National Higher Education Self-study Examination (Computer Science bachelor’s degree).","headline":"08074 Python Exam Sample Questions","mainEntityOfPage":{"@type":"WebPage","@id":"https://lzwjava.github.io/08074-python-exam-samples-en"},"url":"https://lzwjava.github.io/08074-python-exam-samples-en"}</script>
<!-- End Jekyll SEO tag -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Facebook Meta Tags -->
<!-- <meta property="og:url" content="https://lzwjava.github.io"> -->
<meta property="og:type" content="website">
<!-- <meta property="og:title" content="Zhiwei Li's Blog">
<meta property="og:description" content="A personal blog featuring programming insights and projects."> -->
<meta property="og:image" content="https://lzwjava.github.io/assets/images/og/og4.jpg">
<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@lzwjava">
<meta property="twitter:domain" content="lzwjava.github.io">
<!-- <meta property="twitter:url" content="https://lzwjava.github.io"> -->
<!-- <meta name="twitter:title" content="Zhiwei Li's Blog">
<meta name="twitter:description" content="A personal blog featuring programming insights and projects."> -->
<meta name="twitter:image" content="https://lzwjava.github.io/assets/images/og/og4.jpg">
<link rel="stylesheet" href="/assets/css/style.css?v=5e0bd58904df9aa48963217677e20c83bfee34db">
<!-- for mathjax support -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['\\(','\\)'], ['$', '$']],
displayMath: [ ['$$','$$'], ['\\[','\\]']],
processEscapes: false
},
"HTML-CSS": { linebreaks: { automatic: true } },
"CommonHTML": {
linebreaks: { automatic: true }
},
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<!-- <script src="/assets/js/donatePopup.js?v=5e0bd58904df9aa48963217677e20c83bfee34db" defer></script> -->
</head>
<body>
<main id="content" class="main-content post-content" role="main">
<div class="title-row post-title-row">
<h2 class="title post-title">
08074 Python Exam Sample Questions | Generated by AI
</h2>
</div>
<div class="button-container">
<a href="/" class="button left-button">Home</a>
<!-- PDF Button -->
<!-- <a href="#" id="downloadPdfButton" class="button pdf-button" data-file-path="_posts/en/2026-03-03-08074-python-exam-samples-en.md">PDF</a> -->
<!-- Audio Button -->
<!-- -->
<!-- Date Button -->
<!-- <span>_postsen2026-03-03-08074-python-exam-samples-en.md</span> -->
<!-- <span>2026-03-03-08074-python-exam-samples-en.md</span> -->
<a href="#" class="button">2026.03</a>
<button id="themeTogglePost" class="button icon-button" aria-label="Toggle Theme" style="float: right;margin-bottom: 5px;">
<!-- theme-icons.html -->
<svg id="sunIcon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
<svg id="moonIcon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;">
<path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"></path>
</svg>
</button>
<!-- Language Select Section -->
<select id="languageSelect" class="button right-button">
<option value="/08074-python-exam-samples-en" selected>English</option>
<option value="/08074-python-exam-samples-zh" >中文</option>
</select>
</div>
<!-- Audio player for text-to-speech -->
<div class="audio-container">
<audio id="audioPlayer" controls loop style="display:none;">
<source id="audioSource" src="" type="audio/mp3">
Your browser does not support the audio element.
</audio>
</div>
<hr>
<p><strong>Question: Provide 50 sample exam questions from past years for the 08074 Advanced Computer Programming exam in the Guangdong National Higher Education Self-study Examination (Computer Science bachelor’s degree).</strong></p>
<p><strong>Answer:</strong></p>
<p>Actual past exam papers (历年真题) for course code <strong>08074</strong> (计算机高级程序设计) in Guangdong self-study exams are not freely and publicly available online in full form (they are often sold in paid question banks, video courses, or official channels). Official Guangdong self-study exam true questions are typically distributed through authorized platforms or bookstores, and many sites indicate “no past questions available” or redirect to purchase.</p>
<p>However, the exam is based on the textbook <em>Python 语言程序设计基础教程</em> (Fu Qingping et al., Tsinghua University Press, 2022 edition). Exams usually include:</p>
<ul>
<li>Multiple-choice questions (单选题)</li>
<li>True/False questions (判断题)</li>
<li>Fill-in-the-blank (填空题)</li>
<li>Short answer / code analysis (简答 / 程序阅读)</li>
<li>Programming problems (编程题: write code snippets/functions/programs)</li>
</ul>
<p>Below are <strong>50 representative sample questions</strong> compiled in the typical style and difficulty of this course (covering core chapters: basics, control structures, data types, functions, OOP, files, exceptions, modules, strings/regex, GUI basics, etc.). These are modeled after common self-study exam patterns, simulation tests (模拟题), and textbook exercises for Python-based advanced programming courses.</p>
<p><strong>Multiple Choice / Single Selection (单选题) – 1 point each (approx. 20-30% of exam)</strong></p>
<ol>
<li>
<p>In Python, which of the following is an immutable data type?<br />
A. list B. dict C. tuple D. set</p>
</li>
<li>
<p>What is the output of <code class="language-plaintext highlighter-rouge">print(3 ** 2 // 4)</code>?<br />
A. 2 B. 2.25 C. 9 D. 1</p>
</li>
<li>
<p>Which statement is used to define a function in Python?<br />
A. function B. def C. func D. define</p>
</li>
<li>
<p>In object-oriented programming, what does “inheritance” allow?<br />
A. Code duplication B. A class to inherit attributes and methods from another class C. Data hiding only D. Multiple return values</p>
</li>
<li>
<p>Which module is commonly used for regular expressions in Python?<br />
A. os B. sys C. re D. math</p>
</li>
<li>
<p>What does the <code class="language-plaintext highlighter-rouge">with</code> statement primarily handle?<br />
A. Loops B. Exception handling C. Resource management (e.g., file closing) D. Function definition</p>
</li>
<li>
<p>Which of the following creates a list comprehension?<br />
A. [x for x in range(5)] B. {x for x in range(5)} C. (x for x in range(5)) D. {x: x for x in range(5)}</p>
</li>
<li>
<p>In Python 3, what is the type of <code class="language-plaintext highlighter-rouge">input()</code> return value?<br />
A. int B. str C. float D. list</p>
</li>
<li>
<p>Which keyword is used to raise an exception manually?<br />
A. throw B. raise C. except D. try</p>
</li>
<li>
<p>What is the purpose of <code class="language-plaintext highlighter-rouge">__init__</code> method in a class?<br />
A. Destructor B. Constructor C. Static method D. Class variable</p>
</li>
</ol>
<p><strong>True/False (判断题) – 1 point each</strong></p>
<ol>
<li>
<p>Python lists are mutable, while tuples are immutable. (True/False)</p>
</li>
<li>
<p>A function without a <code class="language-plaintext highlighter-rouge">return</code> statement returns <code class="language-plaintext highlighter-rouge">None</code> by default. (True/False)</p>
</li>
<li>
<p>In Python, all exceptions must be caught using <code class="language-plaintext highlighter-rouge">try-except</code>. (True/False)</p>
</li>
<li>
<p>The <code class="language-plaintext highlighter-rouge">global</code> keyword is required to modify a global variable inside a function. (True/False)</p>
</li>
<li>
<p>Python supports multiple inheritance. (True/False)</p>
</li>
</ol>
<p><strong>Fill-in-the-Blank (填空题) – 1-2 points each</strong></p>
<ol>
<li>
<p>The method to add an element to the end of a list is <strong>__</strong>.</p>
</li>
<li>
<p>To open a file for reading and writing (text mode), use <code class="language-plaintext highlighter-rouge">open('file.txt', ____)</code>.</p>
</li>
<li>
<p>The decorator syntax uses the <strong>__</strong> symbol before a function definition.</p>
</li>
<li>
<p>In exception handling, the block that always executes is <strong>__</strong>.</p>
</li>
<li>
<p>To generate random integers between 1 and 10, use <code class="language-plaintext highlighter-rouge">random.______(1, 10)</code>.</p>
</li>
</ol>
<p><strong>Code Analysis / Short Answer (程序阅读或简答题)</strong></p>
<ol>
<li>What is the output of the following code?
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mi">5</span><span class="p">):</span>
<span class="k">return</span> <span class="n">x</span> <span class="o">*</span> <span class="n">y</span>
<span class="k">print</span><span class="p">(</span><span class="n">func</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="k">print</span><span class="p">(</span><span class="n">func</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
</code></pre></div> </div>
</li>
<li>
<p>Explain the difference between <code class="language-plaintext highlighter-rouge">==</code> and <code class="language-plaintext highlighter-rouge">is</code> operators in Python.</p>
</li>
<li>What will happen if you run this code? (Identify the error)
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">try</span><span class="p">:</span>
<span class="n">x</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="mi">0</span>
<span class="k">except</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Error"</span><span class="p">)</span>
</code></pre></div> </div>
</li>
<li>
<p>Describe what a generator function is and give one advantage over a normal list.</p>
</li>
<li>Write the output of:
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">s</span> <span class="o">=</span> <span class="s">"hello world"</span>
<span class="k">print</span><span class="p">(</span><span class="n">s</span><span class="p">.</span><span class="n">capitalize</span><span class="p">())</span>
<span class="k">print</span><span class="p">(</span><span class="n">s</span><span class="p">.</span><span class="n">upper</span><span class="p">())</span>
<span class="k">print</span><span class="p">(</span><span class="n">s</span><span class="p">.</span><span class="n">find</span><span class="p">(</span><span class="s">"o"</span><span class="p">))</span>
</code></pre></div> </div>
</li>
</ol>
<p><strong>Programming Questions (编程题) – 5-15 points each (often require writing functions or small programs)</strong></p>
<ol>
<li>
<p>Write a function <code class="language-plaintext highlighter-rouge">is_prime(n)</code> that returns True if n is a prime number, False otherwise.</p>
</li>
<li>
<p>Write a function to reverse a string without using slicing (<code class="language-plaintext highlighter-rouge">[::-1]</code>).</p>
</li>
<li>
<p>Write code to read a text file “data.txt” and count the number of words in it.</p>
</li>
<li>
<p>Define a class <code class="language-plaintext highlighter-rouge">Rectangle</code> with attributes length and width, and methods to calculate area and perimeter.</p>
</li>
<li>
<p>Use list comprehension to create a list of squares of even numbers from 1 to 20.</p>
</li>
<li>
<p>Write a program that takes user input for a number and prints its factorial using recursion.</p>
</li>
<li>
<p>Handle file not found exception when opening a file and print a friendly message.</p>
</li>
<li>
<p>Write a function that takes a list and returns a new list with unique elements only (preserve order).</p>
</li>
<li>
<p>Use the <code class="language-plaintext highlighter-rouge">re</code> module to check if a string is a valid email address (simple pattern).</p>
</li>
<li>
<p>Create a simple tkinter window with a button that prints “Hello” when clicked.</p>
</li>
<li>
<p>Write code to sort a list of dictionaries by a key (e.g., sort students by age).</p>
</li>
<li>
<p>Implement a decorator that measures and prints the execution time of a function.</p>
</li>
<li>
<p>Read CSV-like data from a file and calculate the average of a numeric column.</p>
</li>
<li>
<p>Write a recursive function to compute the Fibonacci sequence up to n terms.</p>
</li>
<li>
<p>Use <code class="language-plaintext highlighter-rouge">os</code> module to list all .txt files in the current directory.</p>
</li>
<li>
<p>Create a class <code class="language-plaintext highlighter-rouge">BankAccount</code> with deposit, withdraw, and balance check methods.</p>
</li>
<li>
<p>Write code to copy contents from one file to another.</p>
</li>
<li>
<p>Use lambda and map() to convert a list of temperatures from Celsius to Fahrenheit.</p>
</li>
<li>
<p>Implement bubble sort algorithm for a list of numbers.</p>
</li>
<li>
<p>Write a program that finds the most frequent word in a text file.</p>
</li>
<li>
<p>Use try-except-finally to ensure a file is closed after processing.</p>
</li>
<li>
<p>Define a class hierarchy: Animal → Dog and Cat, with a speak() method overridden.</p>
</li>
<li>
<p>Write code to serialize a dictionary to a JSON file using json module.</p>
</li>
<li>
<p>Create a generator that yields Fibonacci numbers indefinitely.</p>
</li>
<li>
<p>Write a complete small program: Accept student names and scores, store in dict, print sorted by score descending.</p>
</li>
</ol>
<p>These samples cover the main knowledge points tested (basics to advanced Python features). For real past papers or more accurate simulations, refer to Guangdong self-study exam official resources, authorized bookstores, or platforms like zikaosw.cn, Bilibili courses, or Taobao study packs that include true questions and mocks.</p>
<p><strong>References:</strong></p>
<ul>
<li><a href="https://www.zikaosw.cn/news/18034564.html">08074计算机高级程序设计自考模拟试题及答案</a></li>
<li><a href="https://www.zikaosw.cn/lnzt/subject-2668.html">自考08074计算机高级程序设计历年真题及答案</a></li>
<li><a href="https://www.zikaosw.cn/news/3947029.html">2022年4月自考08074计算机高级程序设计模拟试题及答案1</a></li>
<li><a href="https://www.afuketang.com/tiku/%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%AB%98%E7%BA%A7%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1">gd-08074 计算机高级程序设计 - 阿福课堂- 题库</a></li>
<li><a href="https://eea.gd.gov.cn/attachment/0/592/592444/4769842.pdf">广东教育考试院 - 教材安排 (confirming textbook)</a></li>
</ul>
<hr>
<div class="button-container">
<a href="/" class="button left-button">Back</a>
<a href="/donate-en" class="button right-button">Donate</a>
</div>
</main>
<script src="/assets/js/dark-mode.js"></script>
<script src="/assets/js/audio.js" defer></script>
<script src="/assets/js/pdf.js" defer></script>
<script>
document.getElementById('languageSelect').addEventListener('change', function() {
var selectedValue = this.value;
if (selectedValue) {
window.location.href = selectedValue;
}
});
</script>
</body>
</html>