Programming
Important Exam Information
Content:
All lesson content included in the exam.
Log in to SNAP to check venue and seat number.
Preparation Advice:
Ensure laptop is in good working condition with adequate storage and memory space.
It is permitted to use Jupyter Notebook during the exam to test code.
Organize notes and have lesson summaries (especially Lesson 26) readily available.
Self-Assessment Paper Structure
Format:
Section A: Multiple Choice Questions
Section B: Fill in the blanks
Section C: Essay coding
Coding Questions Explanation
Python Basics:
Use correct string methods (e.g.,
len,find) from respective lessons.
Sample Coding Questions:
Question on String Methods:
Determine the length of a string:
Answer:
len()returns the length.
Find method:
The
find()method returns the lowest index of the first occurrence; returns -1 if not found.
Use of break statement:
It stops the current loop immediately.
Data Handling: NumPy and Pandas
Pandas DataFrame Definition:
Use square brackets and the column name to select columns in a DataFrame.
Cleaning Data:
For missing values, remember to use
dropna()anddroppeduplicate()for duplicates.
Preparing for Open Book Exam
Suggested to have all Jupyter Notebook files and lesson notes ready during the exam for quick reference.
Python Programming Questions
Common Concepts Discussed:
Loops and Conditional Statements:
Use
forloops to iterate over elements.Understand nested conditions and check inputs using the 'if-else' structure.
Functions:
User-defined functions using the
defkeyword.
Random Choices:
Using
random.choice()for selecting items from a list or array.
Data Visualization with Matplotlib
Always import
matplotlib.pyplot as pltfor plotting.To customize plots, use
plt.title(),plt.xlabel(), andplt.ylabel().For line plots, use
plt.plot()and ensure to specify x and y axis data correctly.