Last active
May 23, 2017 03:19
-
-
Save nioq/5bfd2ee788414cdc37c6417680eddb3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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