Lab 4

Diego Llanes

What is the lab about?

Expected Outcomes

  • experience with for loops
  • experience with the turtle package
  • make awesome looking graphics!!!

for loops

you hopefully all have seen these in class

but in case you havent seen them, heres how they work as a refresher


						for item in iterable:
							print(item)
						

for loops (cont.)

in other words we can do either of the following:


								for i in range(42):            #
									print(i)
								

								list = [1,2,3,4]               #
								for item in list:
									print(item)
								

we just need something that we can routinely take a value out of!

turtles!!! 🐢🐢🐢

you might be thinking to yourself: "okay but what do turtles have to do with python?"

turtle is a package that allows you to make cute and easy little drawings!


							import turtle                        .
							t.forward(100)
							t.left(90)
							t.forward(100)
							turtle.update()
							

what if combine it all?

you can probably see the possibilities of what we could make if we dropped in a loop or two!

give it a spin!

This lab is going to have you print out some cool patterns to the terminal!

Once we're all comfortable with that, were gonna mix in some graphix 😎

chit chat!

Have a blast, ask questions, turn to your neighbor, be friendly, don't bite