Advertisement
zhongnaomi

draw a rectangle

Feb 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. #OBJECT-ORIENTED PROGRAMMING IN PYTHON RASPBERRY PI FOUNDATION
  2. #www.futurelearn.com/courses/object-oriented-principles/6/steps/469430#fl-comments
  3. #https://htmlpreview.github.io/?https://github.com/raspberrypilearning/shapes/blob/master/shapes.html#Shape
  4. #https://raw.githubusercontent.com/raspberrypilearning/shapes/master/shapes.py
  5. from shapes import Triangle, Rectangle, Oval,Paper
  6.  
  7.  
  8.  
  9. rect1 = Rectangle()
  10. rect1.set_x(100)
  11. rect1.set_y(100)
  12. rect1.set_width(50)
  13. rect1.set_height(150)
  14. rect1.set_color('yellow')
  15. rect1.draw()
  16. Paper.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement