User:-Python turtle graphics-/red house: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "import turtle import random import math lado=a=b=50 c = math.sqrt(a**2+b**2) turtle.color('red') def house(): turtle.forward(lado) turtle.left(135) turtle.forw...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==red house==
[[File:Red house.jpg]]
<source lang="python">
import turtle
import turtle



Latest revision as of 08:02, 7 October 2013

red house

Red house.jpg

<source lang="python">

import turtle

import random

import math


lado=a=b=50

c = math.sqrt(a**2+b**2)


turtle.color('red')

def house():

turtle.forward(lado)

turtle.left(135)

turtle.forward(c)

turtle.right(90)

turtle.forward(c/2)

turtle.right(90)

turtle.forward(c/2)

turtle.right(90)

turtle.forward(c)

turtle.right(135)

turtle.forward(lado)

turtle.right(90)

turtle.forward(lado)

turtle.right(90)

turtle.forward(lado)

turtle.left(90)


print house()