daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Feb 21st, 2018 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import turtle
  2. import math
  3. import sys
  4. import time
  5. from turtle import *
  6.  
  7. s = float(input("Enter the length of the sides: "))
  8. if s < 1:
  9.     print("Error: Enter positive value for radius.")
  10.     sys.exit()
  11.  
  12. n = eval(input("Enter the number of parallelograms in the pinwheel: "))
  13. if n < 1:
  14.     print("Error: Enter a positive number of parallelograms.")
  15.     sys.exit()
  16.    
  17. color = input("Enter the color of the parallelogram: ")
  18.  
  19.  
  20. def parallelogram(s, color):#creates a single parallelogram
  21.     turtle.showturtle()
  22.     turtle.shape('turtle')
  23.     time.sleep(3)
  24.     turtle.pensize(3)
  25.     turtle.fillcolor(color)
  26.     turtle.begin_fill()
  27.     fd(s)
  28.     turtle.left(45)
  29.     fd(s)
  30.     turtle.left(135)
  31.     fd(s)
  32.     turtle.left(45)
  33.     fd(s)
  34.     turtle.end_fill()
  35.    
  36.     turtle.done()
  37. print(parallelogram(s, color))
  38.  
  39. #def pinwheel(s ,n, color):
  40. #goal is for this function to call the parallelogram function and create a 8,4, and 3 parallelogram pinwheel
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top