Lesson 1: Course Introduction & INFS1101 Refresher
Computer Programming • College of Computing & Information Technology
Save or Print Notes
Export this study guide as a clean PDF for exam preparation and quick revision.
1. Course Structure & The Five Pillars
INFS1201 builds directly from foundational programming concepts to data manipulation and file handling:
| Pillar | Topic | What You Will Be Able To Do |
|---|---|---|
| 1 | INFS1101 Review | Variables, data types, if statements, loops, input and formatted output. |
| 2 | Functions | Write your own custom def functions, parameters, return values, docstrings. |
| 3 | Data Structures | Master Lists, Nested Lists, Tuples, Sets, and Dictionaries. |
| 4 | Searching & Sorting | Put data in order, binary/linear search, and find items inside collections. |
| 5 | File Processing | Read and write persistent text files and structured CSV data. |
2. Evaluation Scheme & Grading Weights
Assessment Breakdown (Total: 100%)
- Labs (10%): 7 lab sets; the best 4 are counted.
- Quizzes (15%): 5 quizzes across the semester.
- Lab Test (20%): Hands-on programming test at a computer.
- Midterm Exam (20%): Midterm week examination.
- Final Exam (35%): Comprehensive final exams week.
💡 Tip: The final exam (35%) is worth more than all labs and quizzes combined (25%). The two lab components (Labs 10% + Lab Test 20% = 30%) come directly from the lab exercises!
Missed Assessment Rules (Rescue Policy)
| Missed Assessment | What Replaces the Mark | Medical Note |
|---|---|---|
| Quiz or Lab | The next quiz or lab grade | See syllabus |
| The last quiz/lab or Midterm | Your Final Exam grade | Required |
| Lab Test or Final Exam | Deferred sitting arranged | Required |
⚠️ Danger: Only ONE missed assessment is rescued per semester. A second missed item is automatically recorded as ZERO, even with a medical note!
3. Textbook & D2L Organization
- Textbook: OpenStax "Introduction to Python Programming" (free, legal to download in PDF or read online at
openstax.org). - Lecture Section on D2L: Assessment announcements, slides, textbook links, self-assessments, and practice tests.
- Lab Section on D2L: Lab news, exercise sets & solutions, assessment portals, and student grades.
- Effective AI Usage: Use AI as a question machine and for feedback on your own code. Never ask AI for finished code—in the lab test, only what is in your own head counts.
4. INFS1101 Fast Refresher
A. Variables Are Labels, Not Boxes
A variable is simply a name tag attached to a value in memory. Assigning again moves the label to the new value.
name = "Fatima" # str
student_id = 60012345 # int
gpa = 3.62 # float
enrolled = True # bool
print(name, student_id)
print(type(gpa)) # Output: <class 'float'>
B. print() and input()
input()always returns a string (text), never a number!- Joining text:
- Commas:
print("A", "B")adds a space automatically. - Plus:
"A" + "B"concatenates strings with no space.
- Commas:
credits_text = input("Credits: ")
# Convert before calculating:
credits = int(credits_text)
fee = credits * 500
print("Fee:", fee, "QR")
⚠️ Danger:
int("12.5") raises ValueError! Use float("12.5") for decimal strings.
C. Three Kinds of Division
| Operator | Name | Example | Result |
|---|---|---|---|
/ |
Float Division | 7 / 2 |
3.5 (always float!) |
// |
Floor / Integer | 7 // 2 |
3 (whole groups) |
% |
Modulo | 7 % 2 |
1 (leftover remainder) |
Invariant Relationship:
(7 // 2) * 2 + (7 % 2) == 7 is always True!
D. Decisions: if / elif / else
The first condition that evaluates to True executes; all subsequent branches are skipped!
gpa = 3.62
if gpa >= 3.5:
print("Excellent")
elif gpa >= 3.0:
print("Good")
else:
print("Keep going")
⚠️ Danger: Always order conditions from strictest to loosest. If
gpa >= 3.0 came first, a GPA of 3.9 would print "Good" and never reach the 3.5 test!
E. Repetition: The while Loop
Every while loop requires three components:
- Starting value:
lab = 1 - Condition that becomes False:
while lab <= 4: - Step / change inside body:
lab = lab + 1
lab = 1
while lab <= 4:
print("Lab", lab)
lab = lab + 1
print("Done")
⚠️ Danger: If you forget the counter increment, the condition remains
True forever, resulting in an infinite loop.