Assignment 2 – Interactive Learning Resource Draft
By: Omar Katoue, Lamar Kasis, Munabir Mostafa
Overview:
Computer programming has become a crucial skill in today’s day and age. Within the past 50 years, technology has taken a massive leap forward, entering the lives of every single individual, especially with the inception of the internet. Coding is essential when it comes to harnessing the power of today’s technology. Python, an object oriented programming language was created on february 20th, 1991 by Guido van Rossum. This language is widely known for its simplicity and readability, using a clean style and everyday syntax. As the word of electronics continues to grow with no bounds, students must learn how to interact with such devices on a lower level.
Sources:
- Starting Out with Python 4th Edition. By Tony Gaddis
- An Introduction to Python Release 2.2.2 Guido van Rossum Fred L. Drake, Jr., editor
A Misconception when it comes to python:
Many people tend to believe that Coding in python is hard, these people are oftentimes Individuals who have never coded before. Their assumptions often apply to python as well. This can sometimes be true as the syntax often tends to be disorienting and confusing. However python is known to be an easy language to read and code in. Python’s syntax closely resembles the English language.
Learning Activities:
The best way to teach new learners how to code is with hands-on activities. When it comes to learning activities, our main focus is to first introduce the concepts to students then have them implement said concepts into a program. The programs the students will write won’t be overly complex and will mainly rely on the consol.
- Writing âHello Worldâ program:
This ones a classic. Anytime a student learns a new programming language the first thing they must learn is how to create variables, print statements and run a python script. These are usually always taught to new learners by writing code that prints âhello worldâ to the console. The foundations in this learning activity are fundamental when it comes to programming.
- âRock, paper, scissorsâ game:
This will teach students how to create functions, call said functions, if-else statements, for loops, while loops and how to pass input to the program via the command line. All concepts in this learning activities build off of the previous learning activity, it is important for students to have a firm grasp on the previous concepts before starting with this learning activity.
- Multiple Choice quiz:
In this learning activity students will be tested using a multiple choice quiz. Students will be assessed on all previously discussed topics. This will ensure students have retained all of the material that was taught.
Learning outcomes:
In the end students will be able to:
- Understand python fundamentals:
Students will gain a solid understanding of basic python concepts, including data types, variables, if statements, functions and loops.
- Write and run python scripts:
Students will learn how to write Python code and run scripts in order to solve day to day
tasks such as sorting files on a desktop, automating tasks, or sorting through data.
- Evaluate Code and Debug:
Students will gain the ability to read and evaluate python code, identify errors and make
adjustments to correct them.
- Apply Knowledge in Practical Projects:
Students will apply all the knowledge they learned by the end of the course to create practical projects, while reinforcing their understanding of python syntax and structure.
Target Audience:
Our interactive learning resource is mainly targeted towards teens mainly highschool and middle school. We hope our resource will help these students decide if their future career is in computer programming, or if they would like to keep it around as a useful hobby. Students who already decided on coding as a career choice will also benefit
Learning Theory:
While coding in python, instead of reading or memorizing, students interact directly with the code, experimenting with what works, making mistakes and solving problems constantly. Through this process, students reinforce their programming skills by actively creating and refining their own projects. These projects allow students to apply abstract programming concepts in a practical, interactive way.
When students first work with python syntax they can find it confusing, but with constant hands-on activity of writing code, they begin to understand how the different components come together. This process of trial and error mirrors the constructivist idea that knowledge is gained through experimentation. In this context, the learning process is not just about following instructions or memorising syntax, its about interacting with the material. This helps students develop critical problem solving skills and a deeper understanding of how python works.
Core Concepts(with activities & examples):
1. Basics of Python Programming
Core Concept: Printing Output
The print() function is a foundation of programming in Python. It allows the user to display messages or results on the screen.
Example:
print(“Hello, World!”)
Explanation: This code instructs the computer to display the text “Hello, World!” on the screen.
Activity: Modify the message to display a message.
print(“Coding is fun!”)
Core Concept: Comments
Comments are notes in the code, users can write to help explain specific parts. Python ignores comments during execution which helps the user in documenting.
Example:
# This is a single-line comment
print(“This line will run.”) # Comment after a code line
Explanation: Comments start with # and are not executed. Users use them to explain why you wrote the code or to make your program easier to read.
Activity: Add comments to the following code explaining what each line does:
# This program prints a greeting
print(“Welcome to Python!”)
2. Variables and Data Types
Core Concept: Variables
Variables are like labeled containers to store data, such as numbers or text, which can be used in execution in a code.
Example:
name = “Linda”
age = 25
height = 5.4
Explanation:
- name is a variable that stores the text “Linda”.
- age is a variable that stores the number 25.
- height is a variable that stores 5.4.
Variables allow you to reuse and manipulate data. In python variables are loaded with â=â (equal-to sign) and for a variable to be used, it has to be named exactly depending on how it was initialized whether uppercase or lowercase).
Activity: Write a program that declares variables for your name and favorite color, and prints a descriptive sentence using them:
name = “Munabir”
favorite_color = “Red”
print(“Hi, my name is ” + name + ” and my favorite color is ” + favorite_color + “.”)
#Output: Hi, my name is Munabir and my favorite color is Red.
Core Concept: Data Types
Different types of data can be stored in variables:
- String: Text surrounded by quotes (“Hello”, ‘Python’).
- Integer: Whole numbers (e.g., 10, -5).
- Float: Numbers with decimals (3.14, -2.5).
- Boolean: True or False (True, False).
Example:
is_student = True # Boolean
gpa = 3.8 # Float
year = 2024 # Integer
These Variables were stored with the following values with the mentioned data types. The variable is now of the data type that was stored in it.
3. Input and Output
Core Concept: User Input
The input() function lets the program ask the user for information. The information is always stored as a string by default.
Example:
name = input(“What is your name? “)
print(“Hello, ” + name + “!”)
Explanation:
- The program pauses and waits for the user to provide an input, in this case, a name.
- Whatever the user types is stored in the variable name.
- print() then combines the user input with a message to display a personalized greeting.
Activity: Create a program that asks for the userâs age and calculates how many years until they turn 100:
age = int(input(“What is your age? “)) # Convert input to integer
years_to_100 = 100 – age
print(“You will turn 100 in ” + str(years_to_100) + ” years.”)
For instance if the user puts 20, then the program will subtract 20 from 100 and print the age 80.
4. Control Structures
Core Concept: Conditional Statements
Conditional statements allow programs to make decisions based on data.
Example:
age = int(input(“Enter your age: “))
if age < 18:
print(“You are a minor.”)
else:
print(“You are an adult.”)
Explanation:
- if checks if the condition age < 18 is true. If true, it executes the first block of code.
- else runs if the condition is false.
Activity: Write a program to check if a number is positive, negative, or zero:
number = int(input(“Enter a number: “))
if number > 0:
print(“Positive”)
elif number < 0:
print(“Negative”)
else:
print(“Zero”)
Core Concept: Loops
Loops repeat a block of code multiple times.
Example: for Loop
for i in range(5):
print(“Iteration”, i)
Explanation: This loop runs 5 times (from i = 0 to i = 4) and prints the current value of i along with âIterationâ for 5 times.
5. Functions
Core Concept: Defining and Using Functions
Functions are reusable blocks of code designed to perform specific tasks.
Example:
def greetings_coder(name):
print(“Hello, ” + name + “!”)
greeting_coder(“Munabir”)
Explanation:
- def defines the function greetings_coder.
- It takes name as an input and prints a greeting.
- Calling the function (greetings_coder(“Munabir”)) runs its code.
Activity: Write a function that takes two numbers and returns their sum:
def add_numbers(a, b):
return a + b
result = add_numbers(5, 3)
print(“The sum is”, result)
#Output: The sum is 8
Assessment Plans:
1. Assessment Structure
Assessment Type | Weight (%) | Description |
Quizzes | 20% | Multiple-choice and coding snippet questions. |
Coding Assignments | 30% | Practical coding tasks. |
Mini-Project | 30% | A functional Python application solving a real-world problem. |
Final Exam | 20% | A timed, comprehensive assessment of all course concepts. |
2. Detailed Graded Assessments
A. Quizzes (20%)
- Frequency: Weekly or bi-weekly.
- Format:
- Section 1: Multiple-choice questions (e.g., syntax, logic, debugging).
- Section 2: Short coding snippets (e.g., “What is the output of this code?”).
- Example Questions:
- “Which of the following is a valid Python variable name?”
- “Write a single line of Python code to reverse a list.”
- Grading:
- Automated grading for multiple-choice.
- Coding snippet grading is based on accuracy and logic.
B. Coding Assignments (30%)
- Frequency: Assigned after each major module.
- Examples:
- Assignment 1: Create a program to manage a simple to-do list.
- Requirements: Add, remove, view, and mark tasks as complete.
- Grading Criteria:
- Functionality (40%): All required features implemented.
- Code Quality (30%): Clear structure, readability, comments.
- Efficiency (30%): Logical and optimized code.
- Assignment 2: Write a script to fetch and display weather data using an API.
- Grading Criteria:
- API Integration (40%)
- Output Formatting (30%)
- Error Handling (30%)
- Grading Criteria:
- Assignment 1: Create a program to manage a simple to-do list.
Grading Rubric for assignments:
Criteria | Excellent (5) | Good (4) | Average (3) | Poor (2-1) |
Code Functionality | Code runs correctly and meets all requirements | Minor issues but functional | Runs with errors | Does not run |
Code Readability | Well-structured, clear, and commented | Minor clarity issues | Somewhat messy | Unreadable |
Concept Application | Demonstrates deep understanding | Partial understanding | Minimal understanding | Lacks understanding |
C. Project (30%)
- Objective: Develop a Python application showcasing cumulative skills.
- Examples:
- Option 1: Build a text-based game
- Option 2: Create a budget tracker that records and visualizes expenses.
- Option 3: Build a program to analyze and visualize a dataset.
- Grading Rubric:
Criteria | Weight (%) |
Functionality | 40% |
Creativity/Originality | 20% |
Code Quality | 20% |
Presentation | 20% |
D. Final Exam (20%)
- Format: Exam on Python concepts and problem-solving.
- Structure:
- Conceptual Questions (20%): Multiple-choice and fill-in-the-blank.
- Coding Problems (80%):
- Debugging faulty code.
- Writing scripts to solve specific problems.
- Example Questions:
- “Write a Python function to check if a string is a palindrome.”
- “Given a dictionary, write a program to sort it by its values.”
Leave a Reply