How to make turtle in python, make the icon a turtle icon that gets gradually smaller as it goes up the screen.


import turtle
import math
def main():
w = int(input('Width: '))
h = int(input('Height: '))
turtle.setup(w,h)
# Moving turtle
mTurtle = turtle.Turtle()
# function call
#movingTurtle(mTurtle,window)
main()

import turtle
def movingTurtle(mTurtle):
height = turtle.window_height()
width =turtle.window_width()
mTurtle.left(90)
mTurtle.penup()
mTurtle.goto(0,-height/2)
mTurtle.pendown()
initSize = 10
tenthPart = height/10
for x in range(10):
mTurtle.turtlesize(initSize)
initSize-=1
mTurtle.forward(tenthPart)
def main():
w = 1000
h = 1000
turtle.setup(w,h)
myTurtle = turtle.Turtle(shape="turtle")
myTurtle.color("green")
myTurtle.speed(1)
movingTurtle(myTurtle)
screen = turtle.Screen()
screen.exitonclick()
main()
output:

How to make turtle in python, make the icon a turtle icon that gets gradually smaller as it goes ...
I cannot run this code! Please explain and fix it for me import turtle import random # Approximate size of turtle objects in pixels BODY_SIZE = 80 # Half if the body size for collision detection with the edge of the screen HALF_BODY_SIZE = BODY_SIZE / 2 # if enemies get this close to friend there is collision COLLISION_DISTANCE = 5 # The window size SIZE = 500 # inner boundary within window for reversing the direction of enemies LOWER_BOUND...
import random import turtle def isInScreen(win,turt): leftBound = -win.window_width() / 2 rightBound = win.window_width() / 2 topBound = win.window_height() / 2 bottomBound = -win.window_height() / 2 turtleX = turt.xcor() turtleY = turt.ycor() stillIn = True if turtleX > rightBound or turtleX < leftBound: stillIn = False if turtleY > topBound or turtleY < bottomBound: stillIn = False return stillIn def main(): wn = turtle.Screen() # Define your turtles here june = turtle.Turtle() june.shape('turtle') while isInScreen(wn,june): coin = random.randrange(0, 2) if...
The Koch snowflake is a fractal shape. At level 0, the shape is an equilateral triangle. At level 1, each line segment is split into four equal parts, producing an equilateral bump in the middle of each segment. Figure 7-15 shows these shapes at levels 0, 1, and 2. Figure 7-15 First three levels of a Koch snowflake Figure 7-15 First three levels of a Koch snowflake At the top level, the script uses a function drawFractalLine to draw three...
I need help with this code, I have it started here
import sys
import turtle
menu = "Press 1 for Flower"
UserChoice = input(menu)
#function to draw squares
def draw_square(square):
for i in range(0,2):
square.forward(100)
square.right(70)
square.forward(100)
square.right(110)
#function to draw flower
def draw_flower(petalNumber):
window = turtle.Screen()
window.bgcolor("yellow")
pen = turtle.Turtle()
pen.shape("triangle")
pen.color("red")
for number in range(0,petalNumber):
draw_square(pen)
pen.right(360/petalNumber)
for i in range(0,4):
pen.circle(20)
pen.right(90)
pen.right(90)
pen.forward(300)
pen.right(90)
draw_square(pen)
pen.left(180)
draw_square(pen)
pen.left(270)
pen.forward(200)
window.exitonclick()
#function for original art...
Please write a code in python! Define and test a function named posterize. This function expects an image and a tuple of RGB values as arguments. The function modifies the image like the blackAndWhite function, but it uses the given RGB values instead of black. images.py import tkinter import os, os.path tk = tkinter _root = None class ImageView(tk.Canvas): def __init__(self, image, title = "New Image", autoflush=False): master = tk.Toplevel(_root) master.protocol("WM_DELETE_WINDOW", self.close) tk.Canvas.__init__(self, master, width = image.getWidth(), height = image.getHeight())...
Modify the NervousShapes program so that it displays equilateral
triangles as well as circles and rectangles. You will need to
define a Triangle class containing a single instance variable,
representing the length of one of the triangle’s sides. Have the
program create circles, rectangles, and triangles with equal
probability. Circle and Rectangle is done, please comment on your
methods so i can understand
*/
package NervousShapes;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.imageio.*;
import javax.swing.*;
import javax.swing.event.*;
public class...
Please assist. I keep getting the error message in the middle
screen when I run the program on the left. The image on the right
is the section of images.py where it's indicating the issue with
the .split is. How do I fix this?
images.cy - /Users/carrietarpy Downloads/lab9-3/images.py 12.7.18) Python 2.7.18 Shell Python 2.7.15 (v2.7.18:542 102112, Apr 19 2820, 29:48:48) [GCC 4.7.1 Compatible Apple II w 6.3 Clong-FA3.0.57)] on der in Type "help", "copyright', 'credits' or "license()' for more inforyotion...
Step One The most general object in this hierarchy is the Shape. Begin by creating a class for a Shape. It will have data members xand y, which define the upper left-hand corner of the console where the Shape will be drawn. For example is x is 5 and y is 7, the upper left-hand corner of the Shape is 5 spaces from the left margin and 7 spaces from the top margin. Due to the limited size of the standard...
how
to make my code of python work probely
my q is how to write a code to find the average actual water
level, average error by using python
and my program should be flexible where user can select the
column no. If you can see in the main program, it asked which
column to know the maximum or average, the column number is passed
to the function. The function should look which column to do.
#THIS PROGRAMMING IS ABLE...
Game Description: Most of you have played a very interesting game “Snake” on your old Nokia phones (Black & White). Now it is your time to create it with more interesting colors and features. When the game is started a snake is controlled by up, down, left and right keys to eat food which appears on random locations. By eating food snake’s length increases one unit and player’s score increases by 5 points. Food disappears after 15 seconds and appears...