Question

Using turtle for python, and only using the code commands of forward(distance), backward(distance), left(angle), right(angle), penup()...

Using turtle for python, and only using the code commands of forward(distance), backward(distance), left(angle), right(angle), penup() and pendown(), home(), clear(), reset(), form a code that creates and connects the letters J, A, T, and I.

When the code is runned it should print those letters, one after another.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

PYTHON CODE:

import turtle
t = turtle.Turtle()
# Function to draw a J
def drawJ(t, height):
    t.penup()
    t.left(90)
    t.forward(height / 3)
    t.left(180)
    t.pendown()
    t.forward(height / 3)
    t.left(90)
    t.forward(height / 2)
    t.left(90)
    t.forward(height)
    t.penup()
    t.right(180)
    t.forward(height)
    t.left(90)
    t.pendown()

# Function to draw an A
def drawA(t, height):
    t.left(90)
    t.forward(height)
    t.right(90)
    t.forward(height / 2)
    t.right(90)
    t.forward(height)
    t.right(180)
    t.penup()
    t.forward(height / 2)
    t.left(90)
    t.pendown()
    t.forward(height / 2)
    t.penup()
    t.left(90)
    t.forward(height / 2)
    t.left(90)
    t.forward(height / 2)

# Function to draw a T
def drawT(t, height):
    t.penup()
    t.left(90)
    t.forward(height)
    t.right(90)
    t.pendown()
    t.forward(height / 2)
    t.right(180)
    t.penup()
    t.forward(height / 4)
    t.left(90)
    t.pendown()
    t.forward(height)
    t.left(90)
    t.penup()
    t.forward(height / 4)
    t.pendown()

# Function to draw an I
def drawI(t, height):
    t.penup()
    t.forward(height / 4)
    t.left(90)
    t.pendown()
    t.forward(height)
    t.right(180)
    t.penup()
    t.forward(height)
    t.left(90)
    t.forward(height / 4)
    t.pendown()
# Start drawing J A T I
drawJ(t, 150)
t.penup()
t.forward(10)
t.pendown()
drawA(t, 150)
t.penup()
t.forward(10)
t.pendown()
drawT(t, 150)
t.penup()
t.forward(10)
t.pendown()
drawI(t, 150)
turtle.done()

OUTPUT:

FOR ANY HELP JUST DROP A COMMENT

Add a comment
Know the answer?
Add Answer to:
Using turtle for python, and only using the code commands of forward(distance), backward(distance), left(angle), right(angle), penup()...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please help with this python turtle problem using the functions provided. Python Turtle Write a program...

    Please help with this python turtle problem using the functions provided. Python Turtle Write a program using the turtle module to draw the face of a clock that looks like the image below. You will need to use the turtle module for this exercise as well as the bgcolor), shape(), color), penup), right(), forward(), pendown(), and stamp() functions. The code below can be removed or changed as needed. import turtle t turtle.Turtle0 t.forward(75)

  • The following is the code for using Tuturle in Python to write J A T I...

    The following is the code for using Tuturle in Python to write J A T I I have written A T I Please help me write J before A. Everything else is written. Thank you. import turtle from turtle import* #A pd() rt(120) fd(110) lt(180) fd(110) rt(120) fd(110) lt(180) fd(55) lt(60) fd(70) lt(180) pu() fd(130) fd(50) pd() # T lt(90) back(50) fd(100) lt(90) fd(50) lt(180) fd(100) pu() fd(50) #I pendown() left(90) back(100) right(100) penup() forward(50)

  • Writing the code in IDLE. Make sure the code is working. thank you so much Create the following turtle pattern. Using the turtle and random modules, write a program that creates an output as...

    Writing the code in IDLE. Make sure the code is working. thank you so much Create the following turtle pattern. Using the turtle and random modules, write a program that creates an output as the one shown in the picture below. Consider the following: . Change the color of the window to "red" using wn.bgcolor property of the screen variable you create. . Your turtle variable has to have a pen color "white", you have to use the .pencolor property...

  • complete the code The instructions to a turtle can be encoded in a string. Complete Asn4_5...

    complete the code The instructions to a turtle can be encoded in a string. Complete Asn4_5 as follows: In main() the user will be prompted to enter instructions to a turtle as follows. The instructions will be entered in a loop that will end when the user enters quit or Quit at the first prompt. The first prompt will ask for a color. If the user enters quit or the user enters Quit the program will exit. The second prompt...

  • Complete the code The instructions to a turtle can be encoded in a string. Complete Asn4_5 as fo...

    complete the code The instructions to a turtle can be encoded in a string. Complete Asn4_5 as follows: In main() the user will be prompted to enter instructions to a turtle as follows. The instructions will be entered in a loop that will end when the user enters quit or Quit at the first prompt. The first prompt will ask for a color. If the user enters quit or the user enters Quit the program will exit. The second prompt...

  • USING ONLY LOOPS CANNOT USE INDEXING OF STRINGS (STR) PYTHON 3 CODE IS TESTED WITH JDK...

    USING ONLY LOOPS CANNOT USE INDEXING OF STRINGS (STR) PYTHON 3 CODE IS TESTED WITH JDK AND WILL KNOW WHEN USING FORBIDDEN CODE write a program called reversibleSentence -- ask for a word from user -- if word is the same read from left to right or right to left, then -- print "the word is reversible", else -- print "the word IS NOT reversible" HINT: The following program prints heo sentence = "" for x in "hello": if x...

  • A random walk is a particular kind of probabilistic (pseudo-random) simulation that models certai...

    A random walk is a particular kind of probabilistic (pseudo-random) simulation that models certain statistical systems, such as Brownian motion of particles or molecules. Coin flipping is an example of a one-dimensional random walk--one dimensional because you only can go forward (when you flip heads) or backward (when you flip tails) along a straight line. Suppose you take a random walk of nsteps. How many steps away from your starting point would you expect to end up on average, if...

  • The goal is to create a code for implementing a Columns game using pygame Your program...

    The goal is to create a code for implementing a Columns game using pygame Your program will read its input via the Python shell (i.e., using the built-in input() function), printing no prompts to a user with no extraneous output other than precisely what is specified below. The intent here is not to write a user-friendly user interface; what you're actually doing is building a tool for testing your game mechanics, which we'll then be using to automatically test them....

  • For this assignment, you will write a program to work with Huffman encoding. Huffman code is...

    For this assignment, you will write a program to work with Huffman encoding. Huffman code is an optimal prefix code, which means no code is the prefix of another code. Most of the code is included. You will need to extend the code to complete three additional methods. In particular, code to actually build the Huffman tree is provided. It uses a data file containing the frequency of occurrence of characters. You will write the following three methods in the...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT