# HSSlive: Plus One & Plus Two Notes & Solutions for Kerala State Board

## How to Draw a House Using Python Turtle, Tkinter, Matplotlib & Without Libraries

How to Draw a House in Python - There are various methods to create a House using python libraries like turtle, tkinter and matplotlib. Also, you will learn how to make a House using python in easy and simple steps. We have also provided the python code for drawing a House pattern. If you have introductory to intermediate knowledge in Python and statistics, then you can use this article as a one-stop shop for building and plotting House patterns in Python using libraries from its scientific stack, including NumPy, Matplotlib, Pandas, and Seaborn.

Plotting a House in python is a simple procedure, and python in its simplest provides multiple easy methods to do so.

## How to Draw a House using Python?

Given below is the process to draw a House in python using libraries like Turtle, Tkinter, Matplotib and others.

Four Method to make a House in Python using multiple libraries:

1. How to draw a House using python turtle?
2. How to draw a House using python tkinter?
3. How to draw a House using python matplotlib?
4. How to draw a House using python code without library?

## How to Draw a House using Python Turtle?

Check below step by step process to make a House using the python turtle library.

Step

Step 1: Import turtle and math module in Python.

Step 2: Choose a background color for your output screen. You can choose any color, we will use yellow color just to make it attractive.

Step 3: Choose the color and speed of your turtle(pen) who will draw the house on the screen.

Step 4: Now, we need to draw the base of your house and for that, you need to draw a rectangle.

Step 5: Now you created the base, the next step is to create the top of the house. Draw a triangle for the upper portion, just to keep it simple.

Code

import turtle

t = turtle.Turtle()

# for background
screen = turtle.Screen()
screen.bgcolor("yellow")

#color and speed
# of turtle
# creating the house
t.color("black")
t.shape("turtle")
t.speed(1)

# for creating base of
# the house
t.fillcolor('cyan')
t.begin_fill()
t.right(90)
t.forward(250)
t.left(90)
t.forward(400)
t.left(90)
t.forward(250)
t.left(90)
t.forward(400)
t.right(90)
t.end_fill()

# for top of
# the house
t.fillcolor('brown')
t.begin_fill()
t.right(45)
t.forward(200)
t.right(90)
t.forward(200)
t.left(180)
t.forward(200)
t.right(135)
t.forward(259)
t.right(90)
t.forward(142)
t.end_fill()

# for door and
# windows
t.right(90)
t.forward(400)
t.left(90)
t.forward(50)
t.left(90)
t.forward(150)
t.right(90)
t.forward(200)
t.right(180)
t.forward(200)
t.right(90)
t.forward(200)
t.right(90)
t.forward(150)
t.right(90)
t.forward(200)
t.right(90)
t.forward(150)
t.right(90)
t.forward(100)
t.right(90)
t.forward(150)
t.right(90)
t.forward(100)
t.right(90)
t.forward(75)
t.right(90)
t.forward(200)
t.right(180)
t.forward(200)
t.right(90)
t.forward(75)
t.left(90)
t.forward(15)
t.left(90)
t.forward(200)
t.right(90)
t.forward(15)
t.right(90)
t.forward(75)

Output

## How to Draw a House using Python Tkinter?

Check below step by step process to make a House using the python tkinter library.

Step

Code

Output

## How to Draw a House using Python Matplotlib?

Check below step by step process to make a House using the python matplotlib library.

Step

Code

Output

## How to Draw a House using Python Code without Library?

Step

Code

Output

Note: Also, these codes might not run in an online compiler please use an offline compiler. Programmers can make any changes in the code according to their specific requirement.

## Conclusion on How to Draw a House using Python

We hope the programs and methods provided above on how to make a House using python libraries have been helpful to you. If there is any issue in any of the code please let us know in the comments. We will try to resolve it as soon as possible.

Share: