SHARE
TWEET

Untitled

jclingman Aug 14th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from turtle import Turtle
  2.  
  3. jessica = Turtle()
  4.  
  5. def rectangle_area(b,h):
  6.     return b * h
  7.    
  8. def rectangle_circumference(b,h):
  9.     return b + b + h + h
  10.  
  11. def draw_rectangle(t_name, b, h, color):
  12.     t_name.color(color)
  13.     for i in range(2):
  14.         t_name.forward(b)
  15.         t_name.left(90)
  16.         t_name.forward(h)
  17.         t_name.left(90)
  18.     t_name.color("Black")
  19.     t_name.write("Area: " + str(rectangle_area(b,h)), align="center")
  20.        
  21.  
  22.    
  23. draw_rectangle(jessica, 100, 80, "blue")
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