Python Course Structure V3hh
Python Course Structure V3hh
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
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
1. Write a Python script that takes the user's name as input and prints a
personalized greeting.
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
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.
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.
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
Assignment-5
1. Reflection: Write a single-page document describing which string
formatting method has been used in the video.
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
Assignment 6:
1. Reflection: Write a single-page document describing inplace arithmetic
operators and their purpose.
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
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.
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
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
Assignment-10:
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
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
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:
4. Character Count:
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:
2. Function Parameters:
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:
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.
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 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
These tasks and resources are provided to help you deepen your understanding of Python
programming concepts. Good luck with your learning!