Save this video free

CS110A Week 16 Day 1 lesson on Tuesday 12/01/2026.

indika walimuni · 1:15:29 · Watch on YouTube

Part of Indika Walimuni: CS 110A. See all 26 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

CS110A develops a reusable Python turtle function for drawing filled equilateral polygons, deriving a turn angle of 360 divided by the number of sides and using a loop to draw the edges. The lesson also explains how mutable turtle and list objects can be changed through function parameters, introduces DNS lookup and caching, and contrasts local and global scope, including why global-variable changes require the global statement and are usually best avoided.

Key takeaways

Chapters

0:00 Identifying Inputs for a Reusable Polygon Function
2:30 Function Parameters and Changes to Mutable Turtle Objects
7:30 Connecting Polygon Side Counts to Drawing Behavior
12:00 Deriving Turtle Turns from a Polygon's Side Count
16:30 Planning the Polygon Loop with n Minus One Turns
19:30 Writing the Polygon Algorithm and Grouping Coordinates
24:00 Setting the Turn Angle and Repeating Edge-Drawing Steps
28:00 Implementing draw_polygon with Turtle Positioning
33:00 Adding a Numeric Range Loop and Polygon Fill
38:00 Creating a Turtle and Testing the Polygon Function
42:00 Building a Trapezoid from Equilateral Triangles
46:30 How DNS Resolves Domain Names to IP Addresses
55:30 Understanding Local Scope and NameError in Python
1:05:00 Rebinding a Global Name with Python's global Statement
1:11:00 Avoiding Globals and Preparing the Random Turtle Assignment

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 Good morning, guys. Sorry about the delay. Okay, again. All right. So we're going to this is our agenda today. So we're going to solve that problem first, okay? So I already set it up over here. So this is the problem. Equilateral hexagon. And then we we did the not hexagon,

0:48 right? So equilateral polygon. Right? And then we did the hexagon, right? So that's a good match, okay? And then All right. So what are the inputs? What are the inputs in this problem? Yeah, so all of these, right? So polygon of a starting angle, a given number of sides, all of these, right?

1:40 So right? And the side length and given color at a given point, all of these are inputs, okay? So like 1 2 3 4, right? If you take the the the coordinate also as two input, then probably there are about five, right? Or six. Okay? So, all of this. Turtle is an input? Yeah, but since we this is turtle, yeah. Turtle is our drawing tool. I mean, it's up to you. I mean, I'm I'm okay with either way, right? So, turtle yeah, if you pass the turtle, yeah, it's actually an input. Okay? So,

2:31 Mhm. Um inputs eventually become local variable to the function that we passed it. So, input don't take it as in the sense that we use the keyboard to enter input. No, it's we are talking about the function that going to draw the polygon and then all of those going come in as the input to that function and then eventually they become local variables. So, parameters become local variables. Okay? And then the scope is going to be inside the function there. Okay? Yeah, so well, yeah, you pass the turtle

3:27 and then you do something with that

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, indika walimuni.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.