Meetings 26SP

Quick link to Live Python Tutor

Week 1

Wednesday

Thursday

Checklist before you leave:

You might want to start on the homework too! Hints:

  1. Start with something you know works… like your star.
  2. pen.penup()
  3. You don’t have to use forward() and right(); you can also use pen.goto()

Also finish Reading 1 and work on Forum 1 and Quiz 1 if you haven’t yet.

Friday

Upcoming:

Week 2

Monday

Wednesday

Thursday

Lab 2:

Friday

Week 3

Objectives this week:

Monday

Wednesday

Thursday

Friday

Week 4

Objectives

Monday

Section A will do some exercises based on this template, which uses the wordfreq package:

import wordfreq

words = []
for word in wordfreq.iter_wordlist('en'):
    words.append(word)
    if len(words) > 1000:
        break

longest_word = max(words, key=len)
print(longest_word)

Wednesday

Thursday

Friday

Week 5: Looping

Monday

Wednesday

Study strategies we discussed together:

Overall:

Thursday

Lab 5

optional labs:

Friday

Week 6: Functions

Monday

Wednesday

Thursday

If you finish early, you can:

Friday

Week 7: Sequence Data

Monday

Wednesday

Thursday

Lab 7

Friday

Week 8: Object-Oriented Programming (Classes)

Monday

Welcome back from Spring Break!

Has anyone started on Homework 5? We might replace it with a different assignment.

Wednesday

Thursday

Lab 8

If you’re done early, work on Homework 5, which is due next week.

Friday

Week 9: More on Classes

Monday

Optional: Google Colab examples: overview, charts, Gemini (LLM) integration, simple LLM examples, histogram

Friday

Week 10: Web and GUI part 1

Monday

Brython starter template (in Thonny, save as a demo.html file (turn on “All files” in the save dialog so it doesn’t call it demo.html.py) and open in a web browser):

<head>
  <!-- 1. Load the interpreter -->
  <script src="https://cdn.jsdelivr.net/npm/brython@3/brython.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/brython@3/brython_stdlib.js"></script>
</head>

<!-- 2. Start Brython when page loads -->
<body onload="brython()">

  <p id="output">Hello!</p>

  <!-- 3. Write Python here -->
  <script type="text/python">
from browser import document, html
document["output"].text = "Hello from Python!"
  </script>
</body>

Wednesday

Thursday

Note: lab is not due until Tuesday after break.

Friday

Good Friday break, no class.

Week 11: Nested Structures and Web and GUI part 2

Monday

Easter Monday break, no class.

Wednesday

Thursday

Friday

def detect_edges(image):
    """
    Highlights edges in the image using a 3x3 convolution kernel.
    Kernel:
    -1 -1 -1
    -1  8 -1
    -1 -1 -1
    """