Previous Lecture Complete and continue  

  Lesson 6: Fun Fun Function

After watching the video, I want you to write a function that draws a square when you run it.

87 comments
Chastity Lawson
https://repl.it/GChY/2
Kathy Fenster
import turtle

my_turtle=turtle.turtle()

def square():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

square()

I'm getting errors; undefined
Hannah Nyarkoah Nyarko
https://repl.it/GB9T/0
reda echargui
as you can tell i did this whole bunch of squares and as you can see in the code i did not put square after defined it i put my name just to kknow you can put literally whatever you want thats great i love python and creat objects and stuff

import turtle

my_turtle = turtle.Turtle()

def reda():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

reda()
my_turtle.forward(100)
reda()

my_turtle.forward(100)
reda()
my_turtle.forward(100)
reda()
my_turtle.forward(100)
reda()


Derek Ocean
Hi Qazi, love your videos, you are really enjoyable to learn from.

What is the purpose of the parenthesis () immediately after defining or calling a variable?
ex. square()
Marek Ondrejka
https://trinket.io/python/2cbbb6c1b4
Ayush Pande
https://trinket.io/python/83a74c10f6
Chris YJ Chung
import turtle
cc=turtle.Turtle()

def sq():
cc.forward(100)
cc.right(90)
cc.forward(100)
cc.right(90)
cc.forward(100)
cc.right(90)
cc.forward(100)

for i in range(40):
sq()
cc.right(40)
sq()
goutham kumar
import turtle

ttl = turtle.Turtle()

def square():
ttl.forward(100)
ttl.left(90)
ttl.forward(100)
ttl.left(90)
ttl.forward(100)
ttl.left(90)
ttl.forward(100)


for i in range(20):
square()
ttl.left(160)
square()
Christian Sampsell
I got carried away and made an entire grid. I think I'm having a little too much fun :P

import turtle

ttl = turtle.Turtle()

def square():
ttl.forward(100)
ttl.left(90)
ttl.forward(100)
ttl.left(90)
ttl.forward(100)
ttl.left(90)
ttl.forward(100)

square()

ttl.forward(200)

square()

ttl.forward(200)

square()

ttl.forward(200)

square()

ttl.forward(200)
ttl.left(90)
ttl.forward(200)
ttl.left(90)
ttl.forward(100)
ttl.left(90)
ttl.forward(600)
ttl.left(90)
ttl.forward(100)
ttl.left(90)
ttl.forward(400)
ttl.left(90)
ttl.forward(200)
ttl.right(90)
ttl.forward(200)
ttl.right(90)
ttl.forward(100)
ttl.right(90)
ttl.forward(600)
ttl.right(90)
ttl.forward(100)
ttl.right(90)
ttl.forward(100)
ttl.right(90)
ttl.forward(200)
ttl.left(90)
ttl.forward(400)
ttl.left(90)
ttl.forward(200)
ttl.left(90)
ttl.forward(200)
ttl.left(90)
ttl.forward(300)
ttl.right(90)
ttl.forward(300)
ttl.left(180)
ttl.forward(600)
ttl.left(90)
ttl.forward(400)
ttl.left(90)
ttl.forward(600)
ttl.left(90)
ttl.forward(400)
ttl.left(180)
ttl.forward(400)
ttl.right(90)
ttl.forward(300)
ttl.right(90)
ttl.forward(100)



Joshua Madeiros
https://repl.it/FspS/6
James
https://repl.it/FsUq/1
Charlie Cox
import turtle

t = turtle.Turtle()

def square():
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)

square()
AngelRafa
import turtle
turtle = turtle
def square():
turtle.color("orange")
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)

square()
turtle.forward(50)
square()
Ngonidzashe
import turtle
turtle = turtle.Turtle()
def square():
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)

square()
Alex Koo
# how do you leave space between the words?
Cookies="Dildos"
Good="Nasty"
print(Cookies + "are" + Good)
Bramondy Thingujam
when i did it on trinklet it works well but there was a problem when i run the same thing on the python application. I couldn't run the function call part and at the same time python turtle graphics just becomes unresponsive. Help me.
Roberto Catalán
Instead of calling everytime square() is it possible to just code square() * 2?
Erlend Tryti Lindseth
import turtle


cheese = turtle.Turtle()

def square():
cheese.forward(100)
cheese.right(90)
cheese.forward(100)
cheese.right(90)
cheese.forward(100)

square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
Michael Daniels
import turtle

my_turtle = turtle.Turtle()

#defining a function, square, to create a square
def square():
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)

#in order for this to work, you need to call out function, square.
square()

#if you want to make another square, simply call out the function again
my_turtle.forward(100)
square()



cooger
import turtle
fredy=turtle.Turtle()

def square():
fredy.forward(100)
fredy.left(90)
fredy.forward(100)
fredy.left(90)
fredy.forward(100)
fredy.left(90)
fredy.forward(100)

square()
fredy.forward(100)
square()
Max Litja
import turtle

t = turtle.Screen()
t.bgcolor("red")
t_y = turtle.Turtle()
t_y.speed(10)
t_y.color("blue")

def s():
t_y.forward(100)
t_y.right(90)
t_y.forward(100)
t_y.right(90)
t_y.forward(100)
t_y.right(90)
t_y.forward(100)
t_y.forward(100)


s()
s()
s()
s()
alsong dunstan
https://repl.it/FgyS/2
Paul Sherwood Basongit
import turtle

my_turtle = turtle.Turtle()

def n():
for i in range(4):
my_turtle.forward(100)
my_turtle.left(90)

n()
Fedor Vasilyev
import turtle
maya = turtle.Turtle()

def square():
maya.forward(100)
maya.left(90)
maya.forward(100)
maya.left(90)
maya.forward(100)
maya.left(90)
maya.forward(100)

square()
Paul Ojong
it took me a while but I got it C:
Jeffrey Zoslov
import turtle


cheese = turtle.Turtle()

def square():
cheese.forward(100)
cheese.right(90)
cheese.forward(100)
cheese.right(90)
cheese.forward(100)
cheese.right(90)
cheese.forward(100)
cheese.right(90)

square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
cheese.left(45)
square()
Caddy Khaw
import turtle

zz = turtle.Turtle()

def bluesquare():
zz.pencolor("blue")
for i in range(50):
zz.forward(100)
zz.right(90)
zz.forward(1)
zz.right(90)
zz.forward(100)
zz.left(90)
zz.forward(1)
zz.left(90)
zz.left(90)
zz.forward(100)

bluesquare()
zz.forward(200)
bluesquare()
turtle.done()
Paul Ojong
I use Python Shell but i can bacakspace or make a space when I already typed the line should I use another Python ?
brian reaume
Clever Programmers Neighborhood -

import turtle

my_turtle = turtle.Turtle()
def house():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(135)
my_turtle.forward(142)
my_turtle.left(90)
my_turtle.forward(71)
my_turtle.left(90)
my_turtle.forward(71)
my_turtle.left(90)
my_turtle.forward(142)

def Draw():
my_turtle.pencolor("white")
my_turtle.left(45)
my_turtle.forward(20)
my_turtle.pencolor("black")

def Erase():
#my_turtle.pencolor("white")
#my_turtle.pensize(5)
my_turtle.right(135)
my_turtle.forward(100)
my_turtle.pencolor("white")
my_turtle.forward(20)
my_turtle.pencolor("blue")
my_turtle.forward(100)
my_turtle.pencolor("white")
my_turtle.forward(20)
my_turtle.pencolor("green")
my_turtle.forward(100)
my_turtle.right(180)
my_turtle.pencolor("white")
my_turtle.pensize(6)

def Erase_next():
my_turtle.left(45)
my_turtle.forward(20)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(135)
my_turtle.forward(142)
my_turtle.left(90)
my_turtle.forward(71)
my_turtle.left(90)
my_turtle.forward(71)
my_turtle.left(90)
my_turtle.forward(142)

my_turtle.pensize(2)
my_turtle.pencolor("green")
house()
Draw()
my_turtle.pencolor("blue")
house()
Draw()
my_turtle.pencolor("Red")
house()
Erase()
house()
Erase_next()
Erase_next()
Jeremiah Rushin
Nice
Paul Ojong
I tried it but It says Error on some lines
brian reaume
thanks spent a good amount of time cleaning it up and using functions, loops and arguments .


import turtle
import time
my_turtle = turtle.Turtle()

my_turtle.pensize(2)
my_turtle.penup()
my_turtle.goto(-175, 175)
my_turtle.pendown()

def house(color):
my_turtle.pencolor(color)
for i in range(3):
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(135)
my_turtle.forward(142)
for i in range(2):
my_turtle.left(90)
my_turtle.forward(71)
my_turtle.left(90)
my_turtle.forward(142)
time.sleep(.350)

def Draw():
my_turtle.penup()
my_turtle.left(45)
my_turtle.forward(20)
my_turtle.pendown()

def inner(color,L1,L2,A1,A2,A3):
my_turtle.penup()
my_turtle.goto(-173, 173)
my_turtle.pendown()
my_turtle.pencolor(color)
for i in range(4):
my_turtle.forward(L2)
my_turtle.right(A2)
my_turtle.right(A1)
my_turtle.forward(L1)
my_turtle.right(A3)
my_turtle.penup()
my_turtle.goto(-173, -164)
my_turtle.pendown()
my_turtle.right(A3)
my_turtle.forward(L1)

#Draw Houses
for i in range(4):
house("green")
Draw()
house("blue")
Draw()
house("red")
my_turtle.right(45)

inner ("purple", 479, 337, 45, 90, 135)

#Erase Houses
my_turtle.penup()
my_turtle.goto(-175, 175)
my_turtle.pendown()
my_turtle.right(45)

for i in range(4):
house("white")
Draw()
house("white")
Draw()
house("white")
my_turtle.right(45)

inner ("White", 477, 337, 45, 90, 135)
Penny
https://repl.it/F9M4/0 Please check my code. Thanks
john iliadis
pretty cool seeing how things come together
Jeremiah Rushin
Added another shape!!
https://www.repl.it/F6SC/3
André du Rietz
Hey I asked earlier how you make more then one turtle, and I found that out by the basic trial and error process, but I have another question, how do you make multiple turtles run simultaneous?

Plz check my code where i'm using multiple turtles to make a 4x4 square
https://repl.it/F6BM/0
Kevin C
import turtle
x = 100
y = 90
my_turtle = turtle.Turtle()
my_turtle.forward(x)
my_turtle.left(y)
my_turtle.forward(x)
my_turtle.left(y)
my_turtle.forward(x)
my_turtle.left(y)
my_turtle.forward(x)
Denis
Very clear and practical.
Robert de los santos
import turtle

Hello Rafeh
I tried doing this and it just didn't work for me, please explain.
thank you ,
Robert

 import turtle

my_turtle = turtle.Turtle()
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

square()
my_turtle.forward(100)


Python 3.5.2 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
Traceback (most recent call last):
File "python", line 14, in
File "python", line 5, in square
_tkinter.TclError: no display name and no $DISPLAY environment variable

 
Saad Ahmad Khan
I guess you forget to define funcation. try below code.

import turtle


my_turtle = turtle.Turtle()

#Square function definition
def square():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

square()
my_turtle.forward(100)
square()
Saleh xxx

import turtle

my_turtle = turtle.Turtle()

def square():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

^^ and make sure leave distance here
square()
my_turtle.forward(100)
Arian Zahir
https://repl.it/FUCk/1
Saad Ahmad Khan
you forget to call the function
SK MD GALIB
import turtle
galib = turtle.Turtle()
galib.speed(100)
def square():
for i in range(50):
galib.forward(100)
galib.left(90)


square()
Ana Maria Habic
https://repl.it/FWQS/5
Abhijith PG
import turtle
turtle = turtle.Turtle()
def square():
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)

square()
turtle.forward(100)
square()
turtle.forward(100)
square()
turtle.forward(100)
square()
turtle.forward(100)
Shaun
import turtle

my_turtle = turtle.Turtle()

def Square():
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)


Square()
my_turtle.forward(100)
Square()
my_turtle.forward(100)
Square()
my_turtle.forward(100)
Square()
my_turtle.forward(100)
poonam ahir
import turtle

hi = turtle.Turtle()

def square():
hi.forward(100)
hi.left(90)
hi.forward(100)
hi.left(90)
hi.forward(100)
hi.left(90)
hi.forward(100)

square()
hi.forward(50)
square()

Xavier Harris-James
import turtle
my_turtle = turtle.Turtle()
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)

def square():
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
square()
def bob():
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(200)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)

bob()
Te Rauoriwa Wilson
Create a function to reuse code over again

import turtle

my_turtle = turtle.Turtle()


def square():
my_turtle = turtle.forward(100)
my_turtle = turtle.left(90)
my_turtle = turtle.forward(100)
my_turtle = turtle.left(90)
my_turtle = turtle.forward(100
my_turtle = turtle.left(90)
my_turtle = turtle.forward(100


square()
christopher Winters
import turtle

my_turtle = turtle.Turtle()

def square():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

square()
my_turtle.forward(100)
square()



ziad002
import turtle


def square():
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)

square()
turtle.forward(100)
square()
sweta
Hi, It is showing there is a parse error at line 4, could you please check it.

import turtle
t = turtle.Turtle()
def square():
t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)

square()
Aman Tyagi
it works now..

https://repl.it/FJSj/1
ANURAG SHARMA
u need to give some indentations like space or tab after giving the command for defining the function.
like:
def square():
t.forward(100)
t.forward(100)
t.forward(100)
square()
after defining the function u can come back to the default indentation
Fortune
# A function saves us from the hassle of repeating the same line of code over and over.
import turtle
zig = turtle.Turtle()
#define the function saviour
def savior():

zig.forward(100)
zig.left(50)
zig.forward(100)
zig.left(40)
zig.forward(100)
zig.left(50)
zig.forward(100)
zig.left(40)
zig.forward(100)
zig.left(50)
zig.forward(100)
zig.left(39)
zig.forward(100)
zig.left(50)
zig.forward(100)

savior()
print ("yahoo")


savior()

savior()

savior()

savior()

savior()

savior()

savior()

savior()
Aman Tyagi
# A function saves us from the hassle of repeating the same line of code over and over.
import turtle
zig = turtle.Turtle()
#define the function saviour
zig.speed(10)
def savior():

zig.forward(60)
zig.left(40)
zig.forward(60)
zig.left(40)
zig.forward(60)
zig.left(40)
zig.forward(60)
zig.left(40)
zig.forward(60)
zig.left(40)
zig.forward(60)
zig.left(40)
zig.forward(60)
zig.left(40)
zig.forward(60)

savior()
print ("yahoo")


savior()

savior()

savior()

savior()

savior()

savior()

savior()

savior()

#better?
Aman Tyagi
#amateur art work
import turtle


wn = turtle.Screen()
wn.bgcolor('black')
rat = turtle.Turtle()
rat.speed(0)
rat.color('white')
rotate=int(360)


def drawCircles(t,size):
for i in range(10):
t.circle(size)
size=size-4
def drawSpecial(t,size,repeat):
for i in range(repeat):
drawCircles(t,size)
t.right(360/repeat)
drawSpecial(rat,100,10)


cat = turtle.Turtle()
cat.speed(0)
cat.color('yellow')
rotate=int(90)
def drawCircles(t,size):
for i in range(4):
t.circle(size)
size=size-10
def drawSpecial(t,size,repeat):
for i in range (repeat):
drawCircles(t,size)
t.right(360/repeat)
drawSpecial(cat,100,10)

Bat = turtle.Turtle()
Bat.speed(0)
Bat.color('blue')
rotate=int(90)
def drawCircles(t,size):
for i in range(4):
t.circle(size)
size=size-5
def drawSpecial(t,size,repeat):
for i in range (repeat):
drawCircles(t,size)
t.right(360/repeat)
drawSpecial(Bat,100,10)

turtle.done()

Terry = turtle.Turtle()
Terry.speed(0)
Terry.color('orange')
rotate=int(90)
def drawCircles(t,size):
for i in range(4):
t.circle(size)
size=size-19
def drawSpecial(t,size,repeat):
for i in range (repeat):
drawCircles(t,size)
t.left(360/repeat)
drawSpecial(Terry,100,10)
Praneeth
import turtle
a = turtle.Turtle()

# This icode is defing a square
def square():
a.forward(50)
a.left(90)
a.forward(50)
a.left(90)
a.forward(50)
a.left(90)
a.forward(50)
a.left(90)

# this is for drawing a square
square()

Teron Chapman
import turtle
#You can Rename your turtle using a variable. Try it out.
Peter = turtle.Turtle()
#Peter can move according to my command. Watch This.
Peter.forward(100)
#Peter can also turn left and right. Look at Peter go!!
Peter.left(90)
Peter.forward(100)
Peter.left(90)
Peter.forward(100)
Peter.left(90)
Peter.forward(200)
#That's a lot of work to move Peter in a Square! Let's simplify the code by using Variables again.
def square():
Peter.forward(100)
Peter.left(90)
Peter.forward(100)
Peter.left(90)
Peter.forward(100)
Peter.left(90)
Peter.forward(100)
# We've just created a Function! It's an easier way to define a pathway for the Turtle.
# NOTE: Defining the function will not run the function. You have to acknowledge the function in order for it to start!
square()
# You Can Stack functions and give translations to make coding easier!
Peter.forward(200)
square()
Peter.forward(100)
square()
Peter.forward(200)
James Daniel Smith
import turtle


my_turtle = turtle.Turtle()


def square():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

square()

my_turtle.forward(100)

square()
Samson Gao
Here's my 1000 line code for this shape. Looks so nice :O. I wish i could've added color to the cubes

import turtle

my_turtle = turtle.Turtle()

def square():

my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward (100)
my_turtle.left (180)
my_turtle.forward (100)
my_turtle.right (45)
my_turtle.forward(50)
my_turtle.right (45)
my_turtle.forward (100)
my_turtle.right (90)
my_turtle.forward (100)
my_turtle.right(42)
my_turtle.forward (50)
my_turtle.backward(50)
my_turtle.left(42)
my_turtle.backward(100)
my_turtle.right(225)
my_turtle.backward(50)

square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()
my_turtle.right(1)
my_turtle.forward(69)
square()

Ali
https://repl.it/Ezq6/2
Abdulla Omaruddin
import turtle


def square ():
my_turtle = turtle.Turtle ()
my_turtle.forward (100)
my_turtle.left (90)
my_turtle.forward (100)
my_turtle.left (90)
my_turtle.forward (100)
my_turtle.left (90)
my_turtle.forward (100)

square ()
Juan Jose Rios Jr
import turtle
bobby = turtle.Turtle()

def fore():
bobby.forward(100)
bobby.left(90)
bobby.forward(150)
bobby.left(90)
bobby.forward(150)
bobby.left(90)
bobby.forward(150)

fore()
bobby.forward(50)
fore()
bobby.forward(50)
fore()
bobby.forward(50)
fore()
Miroslav
https://repl.it/Ezq6/1
Noah Lemasters
import turtle
my_turtle = turtle.Turtle()
wn = turtle.Screen()
wn.bgcolor('red')
my_turtle.color('black')
def A():
my_turtle.forward(100)
my_turtle.left(45)
my_turtle.forward(100)
my_turtle.left(45)
my_turtle.forward(100)
my_turtle.left(45)
my_turtle.forward(100)
my_turtle.left(45)
my_turtle.forward(100)
my_turtle.left(45)
my_turtle.forward(100)
my_turtle.left(45)
my_turtle.forward(100)
my_turtle.left(45)
my_turtle.forward(100)
my_turtle.left(45)
A()
Ereatara Kokiri
def square(length):
my_turtle.forward(length)
my_turtle.right(90)
my_turtle.forward(length)
my_turtle.right(90)
my_turtle.forward(length)
my_turtle.right(90)
my_turtle.forward(length)

square(100)
square(50)
square(60)
Ereatara Kokiri
def a function and calling a function is awesome
def square():
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)

square()
my_turtle.forward(100)
square()
Anant Dnyaneshwar Gaikwad
https://trinket.io/python/f25ff3675b
Rocelio Garcia
import turtle

fuck = turtle.Turtle()

def fucksquare():
for i in range(4):
fuck.forward(100)
fuck.left(90)

fucksquare()
Rocelio Garcia
import turtle

fuck = turtle.Turtle()
fuck.speed(10)
def fucksquare():
for i in range(4):
fuck.forward(100)
fuck.left(90)

fucksquare()
Diwaker Thakur
import turtle
my_turtle = turtle.Turtle()

def tringle():
my_turtle.forward(100)
my_turtle.left(120)
my_turtle.forward(100)
my_turtle.left(120)
my_turtle.forward(100)
tringle()
my_turtle.forward(100)
tringle()
James Goguen
import turtle

my_turtle = turtle.Turtle()

def Zach():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

Zach()
Xerxes
import turtle

t = turtle.Turtle()

def square():
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)

square ()
t.forward(100)
square ()
sonam chophel
import turtle
wn=turtle.Screen()
wn.bgcolor('red')
ya=turtle.Turtle()
ya.speed(50)
def squeeer():
ya.forward(100)
ya.left(90)
ya.forward(100)
ya.left(90)
ya.forward (100)
ya.left (90)
ya.forward(100)
ya.speed(50)
squeeer()
ya.forward(100)
squeeer()
ya.forward(100)
squeeer()
ya.forward(100)
squeeer()
ya.forward(100)
ya.speed(50)
def smlsquar():
for i in range(4):
ya.forward(80)
ya.left(90)
smlsquar()
ya.speed(50)
def pause():
ya.right(90)
ya.forward(100)
for i in range(3):
pause()
smlsquar()
ya.speed(50)
def msmlsquar():
for i in range(3):
ya.forward(60)
ya.left(90)
for i in range(4):
msmlsquar()
ya.forward(160)
ya.speed(50)
ya.right(135)
ya.forward(141)
ya.right(135)
ya.forward(100)
ya.right(135)
ya.forward(141)
Md Abdullah Al Maruf
import turtle

turtle=turtle.Turtle()

def squre():
turtle.forward(100)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(100)
squre()


turtle.forward(100)
squre()


turtle.forward(100)
squre()


turtle.forward(100)
squre()
Alexander Helms
import turtle


my_turtle = turtle.Turtle()


#square
def square():
my_turtle.forward(100)

my_turtle.left(90)

my_turtle.forward(100)

my_turtle.left(90)

my_turtle.forward(100)

my_turtle.left(90)

my_turtle.forward(100)

my_turtle.right(90)

my_turtle.forward(100)

my_turtle.right(90)

my_turtle.forward(100)

my_turtle.right(90)

my_turtle.forward(100)

my_turtle.right(90)

my_turtle.forward(200)

my_turtle.right(90)

my_turtle.forward(100)

my_turtle.right(90)

my_turtle.forward(100)

my_turtle.right(90)

my_turtle.forward(200)

my_turtle.right(90)

my_turtle.forward(100)

my_turtle.right(90)

my_turtle.forward(100)

def diamond():

my_turtle.right(45)

my_turtle.forward(141)

my_turtle.right(90)

my_turtle.forward(141)

my_turtle.right(90)

my_turtle.forward(141)

my_turtle.right(90)

my_turtle.forward(141)


def half():
square()
diamond()
square()
diamond()

def one():
half()
half()

one()
one()
Nick Fuller
I thought this was pretty cool. I just made another function that used the previously defined function in a way to create three squares at once. (the comments are just what i left when i was messing around with the square function)

import turtle
my_turtle = turtle.Turtle()

def square():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)


#square()
#square()
#my_turtle.left(90)
#my_turtle.forward(100)
#square()


def threesquares():
square()
square()
my_turtle.left(90)
my_turtle.forward(100)
square()

threesquares()
Kyle Judd
import turtle

my_turtle = turtle.Turtle()

def drawSquare():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)

drawSquare()
my_turtle.forward(100)
drawSquare()
shree
import turtle
boom=turtle.Turtle()

def name():
boom.forward(100)
print("my name is shree!!")
x=19
print(x)
name()
print(" it's cool stuf to do it again and again")
name()
Elian Barajas
import turtle

mark = turtle.Turtle()


# here we are defining a function
# we've named our function " square "
# this will instruct mark to form a square
# after defining a function we have to make sure we indent the instructions of our function " square "
def square():
mark.forward(100)
mark.right(90)
mark.forward(100)
mark.right(90)
mark.forward(100)
mark.right(90)
mark.forward(100)

# here we call our function " square "
# then we ask mark our turtle to move forward
# once again we call our function " square "

square()
mark.forward(100)
square()

Abhishek Gaur
Where am I going wrong?

import turtle

# This part makes two squares that look like a uk flag

def uk():

my_turtle = turtle.Turtle()
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(200)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(200)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(200)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(45)
my_turtle.forward(143)
my_turtle.left(135)
my_turtle.forward(200)
my_turtle.left(135)
my_turtle.forward(285)
my_turtle.left(225)
my_turtle.forward(200)
my_turtle.right(135)
my_turtle.forward(143)

uk()
my_turtle.left(45)
my_turtle.forward(200)
uk()

Fortune
Code is ok, Make sure the block is indented after defining the function.
Stefan Kirilov
Hey, Abhishek.

def uk(x,y) - you have to set some attributes to UK For instance where you write forward(100) and left(90) change them to forward(x) and left(y).

After that you need to set some values to X and Y:
uk(100,90)
Stefan Kirilov
@Abhishek Gaur I ran your code, didn't see anything wrong with it.