Skip to content

Instantly share code, notes, and snippets.

@nioq
Last active May 23, 2017 03:19
Show Gist options
  • Save nioq/5bfd2ee788414cdc37c6417680eddb3f to your computer and use it in GitHub Desktop.
Save nioq/5bfd2ee788414cdc37c6417680eddb3f to your computer and use it in GitHub Desktop.
weight = input("What is your weight?")
height = input("What is your height?")
weightnum = float(weight)
heightnum = float(height)
bmi = weightnum / (heightnum * heightnum)
bmistring = str(bmi)
print ("your bmi is " + bmistring)
# square with different colored sides
import turtle
tess = turtle.Turtle()
tess.shape("turtle")
tess.forward(100)
tess.right(90)
tess.color(255,0,0)
tess.forward(100)
tess.right(90)
tess.color(255,255,0)
tess.forward(100)
tess.right(90)
tess.color(0,255,255)
tess.forward(100)
# triangle
import turtle
tess = turtle.Turtle()
tess.shape("turtle")
tess.forward(100)
tess.right(120)
tess.forward(100)
tess.right(120)
tess.forward(100)
tess.right(120)
tess.penup()
tess.goto(-20,10)
tess.pendown()
tess.forward(150)
tess.right(120)
tess.forward(150)
tess.right(120)
tess.forward(150)
# hexagon
import turtle
tess = turtle.Turtle()
tess.shape("turtle")
tess.forward(100)
tess.right(60)
tess.forward(100)
tess.right(60)
tess.forward(100)
tess.right(60)
tess.forward(100)
tess.right(60)
tess.forward(100)
tess.right(60)
tess.forward(100)
tess.right(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment