0% found this document useful (0 votes)
10 views2 pages

Huy Python Lesson Summary

The lesson covered lists in Python, including how to use .append() to store multiple values and loop through them. We learned built-in functions for lists, pass/fail logic, and how to count the number of students who passed or failed based on their scores. For homework, you are to write a program that collects six student scores and outputs various statistics about them.

Uploaded by

cboeblockchain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Huy Python Lesson Summary

The lesson covered lists in Python, including how to use .append() to store multiple values and loop through them. We learned built-in functions for lists, pass/fail logic, and how to count the number of students who passed or failed based on their scores. For homework, you are to write a program that collects six student scores and outputs various statistics about them.

Uploaded by

cboeblockchain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lesson Summary - Python Review (for Huy)

Hi Huy! You were absent today, so here's a summary of what we covered in Python class.
Make sure to review this and try the practice task at the end. Let me know if you have questions!

What We Learned Today

1. Lists and .append()


- We learned how to store multiple values using a list.
- Example:
scores = []
score = int(input('Enter score: '))
[Link](score)
- .append() adds new items to the list.

2. Looping Through Lists


- We used a for loop to go through every item in a list:
for score in scores:
print(score)

3. Built-in Functions for Lists


- len() -> counts how many items
- sum() -> adds all numbers
- max() / min() -> finds the biggest / smallest
average = sum(scores) / len(scores)

4. Pass/Fail Logic
- We used an if inside the loop to check if a score was a pass (>= 50):
if score >= 50:
print('Passed')
else:
print('Failed')

5. Counting How Many Passed or Failed


- We used counters to keep track:
passed = 0
failed = 0
for score in scores:
if score >= 50:
passed += 1
else:
failed += 1

Homework:
Write a program that:
1. Asks for 6 student scores
2. Stores them in a list
3. Prints:
- All scores
- Highest & lowest score
- Average
- How many passed (score >= 50)
- How many failed (score < 50)

Bonus: If everyone passed, print 'Excellent class!'

Let me know when you're done so I can check it for you.


We missed you today! Looking forward to seeing you in the next class!

You might also like