0% found this document useful (0 votes)
31 views

Python Course Structure V3hh

Gh

Uploaded by

razwan shahad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Python Course Structure V3hh

Gh

Uploaded by

razwan shahad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Introduction to Python Basics

Week 1:
Understanding Programming Concepts and Python Basics. Installing Python
and Setting up the Development Environment.
Please read the following article carefully and try to understand the concepts.
https://docs.google.com/document/d/1XvuSdsb314YW3Wt2WWiPW8EtH69wpOZp2jVVA5FaAUU/edit
?usp=sharing

Watch the following video to understand the concepts and learn how to install
the required applications.
https://youtu.be/ScX5EWDhQEw

Assignment-1

1. Using two integers designated as vNum1 and vNum2, calculate their


sum using the + operator, and then print the resulting sum without
user input.

2. Using two integers designated as vNum1 and vNum2, calculate their


sum using the + operator, and then print the resulting sum with user
input. Users should be able to provide two numbers that they want to
add.

3. Reflection: Write a 2–3-page document reflecting on the video


tutorial, describing:

a. What were the key steps involved in creating pentagons,


triangles, and hexagons using the Turtle module?

b. Discuss the significance of using a graphics module like Turtle


in Python for educational purposes, particularly in teaching
concepts such as geometry and programming logic
simultaneously.
c. What are some of the fundamental Turtle module commands
or functions demonstrated in the video, and how did they
contribute to the creation of geometric shapes?

d. In your own words, describe the role of the Turtle module in


Python and its relevance in the context of computer graphics
and educational programming.

e. Reflect on any challenges or difficulties you encountered while


following the video tutorial and how you overcame them, if
applicable.

f. How does experimenting with parameters such as angles, side


lengths, and colours in the Turtle module enhance your
understanding of geometric concepts and programming
principles?

These questions are designed to encourage critical thinking, reinforce


understanding of programming concepts, and promote active
engagement with the Turtle module and geometric shapes in Python.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 2:
Data Types: Strings, Integers, Floats, Lists, Sets, and Booleans

Watch the following video and make sure you understand all the concepts:
https://youtu.be/vbi8XU0aWbU

Assignment-2

Objective: This assignment aims to familiarize students with basic Python


syntax and variables. The concept of variables will be discussed in detail in
Week 3. It is recommended that you watch the Week 3 video before
completing the following assignments.

1. Write a Python script that takes the user's name as input and prints a
personalized greeting.

2. Calculate the area of a rectangle with a user-specified length and


width. Print the result.

3. Reflection: Write a 2–3-page document reflecting on the video


tutorial. Describe different data types mentioned in the video and
provide some examples.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 3:
Variables in Python
Watch the following video and ensure you understand all the concepts:
https://youtu.be/o_htvp03s2c?si=vsP9CtLOTrlTOwwU

Assignment-3

Objective: This assignment aims to familiarize students with basic concepts of


variables and their appropriate use.
1. Write a Python script that uses several valid variable names to store
strings, integers, floats, lists, and dictionaries. Please refer to the
video in week 2. Submit a single .py file for this assignment via
Google Classroom when instructed.

2. Create another Python program that uses the type() function to


describe the type of the variables. Please use all commonly used data
types described in the video from week 2. Print the results.

Assignment 3.2: Student Grade Calculator

1. Develop a Python program that calculates the average grade of


students based on their scores in multiple subjects.

Requirements:

a. Define variables for the number of subjects and the total scores.
b. Ask the user to input the number of subjects.
c. Use a loop to input scores for each subject and calculate the total
score.
d. Calculate the average grade (total score divided by the number of
subjects).
e. Display the average grade along with a grading scale (e.g., A for
90-100, B for 80-89, etc.).
Example Output:

Challenge: Implement validation to ensure that the input scores are within a
valid range (e.g., 0-100 for grades).

These assignments will require students to utilize variables effectively, handle user
input, perform calculations, and apply conditional logic as needed. They provide
practical exercises that can enhance students' understanding of variables and
programming concepts in Python.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 4:
Arithmetic Operators in Python: Basic Operators and Expressions
Watch the following video and ensure you understand all the concepts:
https://youtu.be/sV-sXz1_hVA?si=i3bUV7IOpdG0N5Kk

Assignment-4
1. Write a Python script that takes input from users and prints a times
table. Please refer to the video above if you need help. Submit a
single .py file for this assignment via Google Classroom when
instructed.

2. Reflection: Write a 2-page document reflecting on the video tutorial,


describing what arithmetic operators are in Python. Why did we use
the int() function in the video? How many different arithmetic
operators were used in the video?

3. An Alt code was used in the video. What is the code, and what does it
do? Provide some other examples of Alt codes of your choice that
can be used for mathematical operations.

1. Type the following in you IDE:

Check to see what you get as a result and explain your findings in a single-page
document. Please submit the document to Google Classroom when requested.
Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 5:
String Formatting
Read the following article to understand what string formatting is. Questions
will be asked from this document during the final exam.
https://docs.google.com/document/d/1dd1xENeQUEWBtVP_f1siq7emSU2mt8e3/edit?usp=sharing&ouid=1096828849965
87265402&rtpof=true&sd=true

Watch the following video to answer the questions that follow:


https://youtu.be/sUHx9HMKeZI?si=hmUgDmzblXvPZUPi

Assignment-5
1. Reflection: Write a single-page document describing which string
formatting method has been used in the video.

2. Describe the purpose of `{vnum:.5f}` and what it does. Explain your


answer in a single-page document. Please submit the document to
Google Classroom when requested.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 6:
Inplace Arithmetic Operators
Read the document below and make sure you understand it thoroughly.
https://docs.google.com/document/d/1H_3if36gb8bCP3tgp3KlzlS7QchTbLyRS0gdtVD5uc8/edit?usp=sharing

Watch the following video to answer the questions that follow:


https://youtu.be/kaeC2bVGOhA?si=WQKjax2GiE1PbWxc

Assignment 6:
1. Reflection: Write a single-page document describing inplace arithmetic
operators and their purpose.

2. Identify another important concept used in the video.

3. Write a Python script to create a times table as shown in the video using
a while loop. Submit a single .py file to Google Classroom when
requested.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 7:
List Comprehension
Read the following article to understand what a list comprehension is.
Questions will be asked from this document during the final exam.
https://docs.google.com/document/d/1uhZWDYNZFKtRyDy6XVx3jLWyl0boPD1S/edit?usp=sharing&ouid=1096828849965
87265402&rtpof=true&sd=true

Watch the following video to answer the questions that follow:


https://youtu.be/4JJ4BEzxoPc?si=8s20jf0XTLSGsIhh

Assignment 7:
1. Reflection: Write a single-page document defining and describing list
comprehension and discussing the benefits of using list comprehension.
2. Create a simple program that uses list comprehension. You can use
examples from the video or come up with your own program.

Week 8:
Loops - for and while loops
Read the following document to understand loops in Python, including for and
while loops. Questions will be asked from this document during the final exam.
https://docs.google.com/document/d/1ewGfIFDFyu1e9jGFO9g6ztsZi5ypkCWl/edit?usp=shar
ing&ouid=109682884996587265402&rtpof=true&sd=true

Assignment 8:
1. Reflection: Write a single-page document defining and describing loops
in Python and explaining why they are super useful in programming.

2. Recreate the two projects described in the following video:


https://youtu.be/qCOoKwyMqvs?si=UDt3sMv0oqFBlF0U

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 9:
Control Flow: if statement and conditions

Read the following article to understand what control flow and if statements
mean. Questions will be asked from this document during the final exam. It is
important to know the definition of Control Flow in Python by heart.
https://docs.google.com/document/d/1v0XTyenSvP_b8tK1c5XnX7ddND_jFIj2/edit?usp=sha
ring&ouid=109682884996587265402&rtpof=true&sd=true

Watch the following video to understand the concepts:


https://youtu.be/UGLECpPRwu4?si=2iCaibzsq79qD8

Assignment-9:
1. Reflection: Write a single-page document describing your understanding
of control flow and how it is used in programming for decision-making.

2. Create two projects of your choice that use control flow by using if, elif,
and else statements.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 10:
List and Dictionary – Data Types

Watch the following video to understand the concepts:


https://youtu.be/Pc6VeBifZnc?si=cR7ME1Ysu_dq0SaH

Assignment-10:

1. Create a Python list that has numbers from 1 to 10 in random order. In


the program, write three print statements showing index positions of
three different numbers from the list that you created. Submit a single
.py file to Google Classroom when requested.

2. Recreate the solution to a challenge from leetcode.com using different


variable names. Submit the .py file to Google Classroom when requested.

3. Write a 1-2 page document discussing leetcode.com and how it can be


used to improve skills in Python and prepare for job opportunities in
international markets, enabling earning in foreign currencies. Submit the
document to Google Classroom when requested.

4. Create two projects of your choice from leetcode.com and submit the
.py files to Google Classroom when requested.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 11:
Code Execution – Code execution in a Python project using dictionaries
Watch the following video to understand the concepts:
https://youtu.be/2wAz6xilsnw?si=PkKTba3cUgN0g1df

Assignment-11

1. Reflection: Write a 1–2 page document describing why it is important to


understand how code executes in any program. Provide a detailed
reflection on what you learned in the following video:
Submission Guidelines: Submissions should be uploaded to the Google Classroom assignment
when requested.
Week 12:
Slice Operator
Read the following article to understand what a slice operator is. Questions will
be asked from this document during the final exam.
https://docs.google.com/document/d/1JsUE7yG_Xo2f1q1MVcD7ZvI4Sxi6DNjV/edit?usp=sh
aring&ouid=109682884996587265402&rtpof=true&sd=true

Watch the following video not only to understand the concepts but also see
the slice operator in action to solve a leetcode.com challenge.
https://youtu.be/laX4I9EDwPc?si=BSSQgwsHiLQdoZq5

Project: Text Analyzer


Project Description:

The Text Analyzer project is designed to help students analyse text input
provided by the user. It involves processing the text to extract useful
information such as word count, character count, and generating word
frequency statistics using the slice operator.

Features to Include:
1. Word Count: Calculate the total number of words in the input text.
2. Character Count: Calculate the total number of characters in the
input text.
3. Word Frequency: Generate a dictionary that stores the frequency of
each word in the text.

2. Implementation Steps:

1. Input Processing:

a) Ask the user to input a piece of text (could be a paragraph


or multiple sentences).
b) Clean the input text by removing any leading or trailing
whitespace characters.
3. Word Count:
a) Split the cleaned text into words using the `split()` method.
b) Use the slice operator to get a sublist of words for
counting.

4. Character Count:

a. Use the slice operator to get a sublist of characters from the


cleaned text for counting.

5. Word Frequency:
a) Create an empty dictionary to store word frequencies
(`word_freq = {}`).
b) Iterate through the list of words obtained from the cleaned
text.
c) For each word, update its frequency in the dictionary using
the slice operator to access and modify the dictionary.

6. Display Results:
7. Print the word count and character count obtained in steps 2 and 3.
8. Display the word frequency statistics by printing the word-frequency
dictionary.

Project Extensions:
1. Implement additional features such as finding the longest word, shortest
word, or average word length in the text.
2. Allow the user to analyse text from a file rather than inputting it
manually.
3. Enhance the word frequency analysis by excluding common stop words
or implementing stemming/lemmatization for better accuracy.
4. This project provides a practical application of the slice operator while
also improving students' understanding of text processing and basic
data analysis in Python.
https://docs.google.com/document/d/1ValijpiTSitk0mzKuhwokgGe-
VXtTA2x/edit?usp=sharing&ouid=109682884996587265402&rtpof=true&sd=true

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 13:
Functions
Watch the following video to understand functions and answer the questions
that follow:
https://youtu.be/TrLY3Az_wFM?si=FchLHO4fmNm8pE-A

Task:
The video describes some built-in functions and a couple of user-defined
functions were also created in the video. Write a minimum of a 2-page article
describing some of the built-in functions used in Python. Python comes with a
substantial number of built-in functions that are readily available for
programmers to use. These functions are part of the Python standard library
and cover a wide range of tasks, from basic operations to more specialized
functionalities. The exact count can vary slightly depending on the Python
version and distribution, but typically, there are over 60 built-in functions in
Python 3. Please search online to find more built-in functions and provide a list
of at least 15 built-in functions in Python, including those mentioned in the
video.
Assignment 13:
Exploring Functions in Python
Objective:
The objective of this assignment is to deepen your understanding of functions
in Python, including function definitions, parameters, return values, and
function calls.
1. Function Basics:

Define a function named `greet_user` that takes a parameter `username` and


prints a greeting message like "Hello, [username]! Welcome to Python
Functions."

2. Function Parameters:

Define a function named `calculate_area` that takes two parameters `length`


and `width` and returns the perimeter of a rectangle (Perimeter=2×(length +
width)).
3. Default Parameters:

Define a function named `calculate_volume` that takes three parameters


`length`, `width`, and `height`, where `height` is optional with a default value of
1. This function should return the volume of a rectangular prism (volume =
length * width * height).

4. Return Values:

Define a function named `is_even` that takes a parameter `number` and returns
`True` if the number is even, otherwise `False`.

5. Function Calls:

Call each of the functions defined above with appropriate arguments and print
the results.

6. Function Composition:

Define a function named `calculate_total_cost` that takes parameters `price`


and `quantity` and calculates the total cost (total_cost = price * quantity). Then,
define another function named `apply_discount` that takes parameters
`total_cost` and `discount_rate` (default value 0.1 for 10% discount) and
returns the discounted cost. Finally, call these functions in sequence to
calculate and print the discounted cost.

7. Challenges (Optional):

Create your own custom functions with different functionalities and use them
in meaningful ways to solve problems or perform calculations.

Submission Instructions:
- Write Python code to complete the tasks outlined above.
- Organize your code neatly with appropriate comments.
- Include meaningful variable names and function names.
- Test your functions with different input values to ensure correctness.

This assignment structure covers a range of concepts related to functions in Python,


from basic function definitions to more advanced topics like default parameters and
function composition. Students will have the opportunity to practice writing functions,
working with parameters, and understanding return values, which are fundamental
skills in Python programming. Feel free to modify or expand upon these tasks based on
your students' proficiency level and learning objectives.

Submission Guidelines: Students should create a single Python script (.py file) containing the
code for all tasks. The code should be well-commented. Optionally (not mandatory), you can
follow the PEP 8 style guidelines. Submissions should be uploaded to the Google Classroom
assignment when requested. Please search online to find out what the PEP 8 style guidelines
are.
Week 14:
Following video will help you to complete this project.
https://youtu.be/GWl__ViVt74?si=-etlPxJHUasBD1TR

Project Title: Even Numbers Sorter


Project Description:
In this project, you will write a Python program to find all the even numbers
from a given list of integers and then sort them in descending order.

Project Tasks:
1. Create a Python script or function that takes a list of integers as input.
2. Write code to filter out only the even numbers from the input list.
3. Implement sorting functionality to arrange the even numbers in descending
order.
4. Test your program with different lists of integers to ensure it works correctly.
5. Provide a user-friendly interface or instructions for inputting lists and
displaying the sorted even numbers.

Project Requirements:
1. The program should handle both positive and negative integers in the input
list.
2. Ensure that the program properly sorts the even numbers in descending
order.
3. Include comments and clear variable names to enhance code readability.
4. Test the program with various input lists, including edge cases like an empty
list or a list with only odd numbers.
Bonus Tasks (optional):
Modify the program to accept user input for the list of integers.
Implement error handling to deal with invalid input, such as non-integer
elements in the list.
Add functionality to calculate and display the sum of the sorted even numbers.
The project "Even Numbers Sorter" is designed to help you practice filtering and sorting even numbers from a list of
integers in Python. It includes a set of tasks and requirements to ensure your program is robust and user-friendly.
Good luck with your project!
Week 15:
Task: Create a new script to achieve the same functionality as in week-14, but
this time use a function and the built-in `sorted()` function.
https://youtu.be/9D9T_-M7BHk?si=9i7vOiVoFUKzfj-b

Week 16:
Watch the following video to understand how to create a function that
identifies prime or composite numbers.
https://youtu.be/nbi2HaX6NWs?si=jFW0SbMplLYgEHqt

There are no assignments this week, but it is likely that you may be required to
recreate this project in the final exam.

Week 17:
Watch the following video to understand how to create a function that
identifies prime or composite numbers.
https://youtu.be/Ug90jEzqHEc?si=vQJOEyM9Vx201jlQ

There are no assignments this week, but it is likely that you may be required to
recreate this project in the final exam.

Week 18:

Please read the following article carefully and try to understand the concepts:
https://docs.google.com/document/d/1ImKrtmFMOK4PuMBSRu7ODQxdDFTguBGW/edit?usp=sharing&ouid=
109682884996587265402&rtpof=true&sd=true

Watch the following video to understand how to create a function that


identifies prime or composite numbers.
https://youtu.be/OLlB06K8Rvg?si=hbG9FNeAtyRaxYQe

These tasks and resources are provided to help you deepen your understanding of Python
programming concepts. Good luck with your learning!

You might also like