I cannot figure out how to limit the number that they can make the bars of the turtle go too. I need to find a way to make them not go any higher than 200.


import turtle

Jane = turtle.Turtle()


bar1 = int(input("What is the height of the first bar?" ))


bar2 = int(input("What is the height of the second bar?" ))


bar3 = int(input("What is the height of the third bar?" ))


bar4 = int(input("What is the height of the fourth bar? "))


Jane.left(90)


def bar(height):


Jane.forward(height)


Jane.left(90)


Jane.forward(20)


Jane.left(90)


Jane.forward(height)


Jane.right(180)



bar(bar4)


bar(bar3)


bar(bar2)


bar(bar1)

Answers

Answer 1

Answer:

import turtle

Jane = turtle.Turtle()

bar1 = int(input("What is the height of the first bar?" ))

bar2 = int(input("What is the height of the second bar?" ))

bar3 = int(input("What is the height of the third bar?" ))

bar4 = int(input("What is the height of the fourth bar? "))

Jane.left(90)

def bar(height):

   if height > 200:

       height = 200

   Jane.forward(height)

   Jane.left(90)

   Jane.forward(20)

   Jane.left(90)

   Jane.forward(height)

   Jane.right(180)

bar(bar4)

bar(bar3)

bar(bar2)

bar(bar1)


Related Questions

Other Questions
Situation analysis is an ongoing process, referred to as______.A. monitoring the statusB. reading the trendsC. scanning the environmentD. benchmarking the field 3. why was minhaj reluctant to invite school friends to his home? in The average height of young adult males has a normal distribution with standard deviation of 2.7 inches. You want to estimate the mean height of students at your college or university to within one inch with 93% confidence. How many male students must you measure? Two identical vessels are taken and painted white and black respectively. Then the same quantity of water is poured into each one of them. Both the vessels are left in the sun, and the temperature is noted regularly. The water is which vessel is likely to get hotter and why? what does the windows update delivery optimization function do? answer delivery optimization lets you set active hours to indicate normal use for your device. the device will not reboot to install updates during this time. delivery optimization lets you know when and if there are any urgent updates for your system and provides you with an option to download and install them. delivery optimization lets you view the updates you have installed. it also lets you uninstall an update if needed. delivery optimization provides you with windows and store app updates and other microsoft products. What does the photograph in the passage called A Cleaner Earth help the reader understand? A How the wind turbines are built on a wind farmB How hard the wind blows to turn the wind turbineC How a wind turbine can produce electricityD What the wind turbines look like on a wind farm Portfolio for Unit 5Part 1: Car Wheel Project CDE is a tangent to the circle below. Calculate the size of angle . Fully Justify your answer. People who practice ________ use only peaceful ways to achieve change. Which of these sentences would most likely be used on web site that tells the history of chocolate 11Differentiate the function and find the slope of the tangent line at the given value of the independent variable s=8-41, 1=-3 s'(t)=0 The slope of the tangent line is at t= -3. Note that common skills are listed toward the top, and less common skills are listed toward the bottom. according to o*net, what are common skills needed by construction carpenters? select three options.programmingcritical thinkingtechnology designoperation monitoringtime managementscience On a number line, point A is located at -3 and point B is located at 19. Find coordinate of a point between A and B such that the distance from A to point B is 3/11 of distance A to B Marcus estimated the mass of a grain of sugar as 6 x 10-4 gram. Based on thatestimate, about how many grains of sugar are there in a small bag of sugarthat weighs 0. 24 kilogram? Secondary to the most recent recession, officials have sought different ways to reduce recidivism and rates of incarceration. These alternatives have included: sec in simplest radical form. were the riots that took place after mlk's assassination were justified? why or why not The monopolistically competitive firm's economic profit per unit when producing at q1 units of output ______. multiple choice question. equals p1 is the difference between p1 and a1 equals zero equals a1 multiplied by p1 When a provider is convicted of corporate noncompliance. A retail store has a preferred customer plan where customers can earn discounts on all their purchases. the amount of a customers discount is determined by the amount of the customers cumulative purchases in the store as follows: a. when a preferred customer spends $500, he or she gets a 5 percent discount on all future purchases. b. when a preferred customer spends $1,000, he or she gets a 6 percent discount on all future purchases. c. when a preferred customer spends $1,500, he or she gets a 7 percent discount on all future purchases. d. when a preferred customer spends $2,000 or more, he or she gets a 10 percent discount on all future purchases. required:design a class named preferredcustomer, which extends the customer class.