answersLogoWhite

0

import turtle

from random import*

def star(a,b,c,d):

x=5

y=0

turtle.color(a)

turtle.begin_fill()

turtle.penup()

turtle.goto(c,d)

turtle.pendown()

while x>0:

turtle.forward(b)

turtle.right(144)

turtle.forward(b)

x-=1

turtle.end_fill()

star('red',100,0,0)

def length():

randvar=randrange(5,71)

def x():

randvar=randrange(-280,281)

def y():

randvar=randrange(-200,201)

def night_sky():

z=int(input('How many stars do you want?'))

a=random_color

b=length

c=x

d=y

while z>0:

star(a,b,c,d)

z-=1

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

How do you draw HELLO WORLD in python?

There are a couple of ways: 1. Use turtle. It is a module that can be imported. 2. The print function 3. Use tkinter. It is a module in python that you can import.


What is the code to draw a square in python programming language?

To draw a square in Python, you can use the turtle graphics library. Here’s a simple code snippet: import turtle t = turtle.Turtle() for _ in range(4): t.forward(100) # Move forward by 100 units t.right(90) # Turn right by 90 degrees turtle.done() # Finish the drawing This code sets up a turtle graphics window and draws a square with each side measuring 100 units.


How do you open a python script on the mac terminal?

python filename.py


How do you open a Python program with MS-DOS?

open MS-DOS in the directory you have the python file in. type "python [INSERTNAMEOFSCRIPT]"


How do you draw a house in python GUI?

To draw a house in Python using a GUI, you can use the tkinter library. Start by creating a canvas with Canvas() and then use methods like create_rectangle() to draw the house's base and create_polygon() for the roof. Here's a simple example: import tkinter as tk def draw_house(canvas): canvas.create_rectangle(50, 150, 150, 250, fill="lightblue") # House base canvas.create_polygon(50, 150, 150, 150, 100, 100, fill="brown") # Roof root = tk.Tk() canvas = tk.Canvas(root, width=200, height=300) canvas.pack() draw_house(canvas) root.mainloop() This code creates a simple house shape with a rectangular base and a triangular roof.

Related Questions

How do you draw a python?

Get a picture of the internet, and draw proportionate.


How do you draw a seven pointed star?

Draw seven points!


How do you draw HELLO WORLD in python?

There are a couple of ways: 1. Use turtle. It is a module that can be imported. 2. The print function 3. Use tkinter. It is a module in python that you can import.


How to draw a nautical star?

check out this site... it shows you how to draw a nautical star. hope this helps someone. http://www.dragoart.com/how-to-draw-a-nautical-star-t288-1.htm go die in a hole


How might one draw a perfect star?

There are a few different types of star that can be drawn including a six pointed star and a five pointed star. Generally the best was to draw a perfect star is either with a lot of practice or to use a stencil.


What powers a star?

Box office draw.


On the game scratch how do you make a star?

To create a star in Scratch, you can either draw it using the built-in paint editor or use code to draw it programmatically. If you choose to draw it, open the "Costumes" tab, select the paintbrush tool, and create a star shape. Alternatively, you can use the "Pen" blocks in the coding area to draw a star by moving the sprite in a specific pattern, adjusting the angles and lengths of the lines to achieve the star shape.


Draw a hybrid topology with a star backbone and three ring networks?

Draw a hybrid topology with a ring backbone and three bus networks.P


How do you draw a python snake?

A person can draw a picture of a milk snake by studying a photo of the snake itself. A person should be sure to include important and unique features such as the light colored body with the orange spots.


What Monty Python member went on to star in Ripping Yarns and in a series of travel documentaries?

Michael Palin


How do you put a star by your name on myspace?

you just draw it


What can you draw for the word amazing?

a star maybe or a diamond