Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3.6 Question 11A (6 points) Write a function named tri that uses turtle graphics to draw three lines of equal length with a common

Python 3.6

image text in transcribed

Question 11A (6 points) Write a function named tri that uses turtle graphics to draw three lines of equal length with a common point of origin. Each line should be rotated 120 degrees relative to the previous line The function tri takes two parameters: 1) t, a turtle that is used for drawing 2) length, an integer that is the length of each line The turtle t is initially at the point of intersection of the three lines. The function tri should draw beginning at the turtle's initial location and orientation, and should exit with t in the same location and orientation. Do not make any assumptions about the initial up/down state of the turtle. For full credit you must use a loop for repeated operations. The following is correct sample input and output. import turtle s = turtle.screen() aTurt = turtle. Turtle() tri(aTurt,100) Question 11B (14 points) Write a function named tris that uses turtle graphics and the function tri in question 11A to draw a sequence of tri's of specified size and rotation The function tris takes 5 parameters: 1) t, a turtle used for drawing 2) initSize, the length of a line in the first tri 3) ratio, a floating point number greater than 1.0 that is the ratio of the length of the lines of successive tri's 4) rotation, the angle that each tri is rotated counterclockwise relative to the previous ti 5) num, the number of tri's to draw If tris is called by the following code, this would be correct graphical output. import turtle s - turtle.Screen() shelly = turtle. Turtle() tris(shelly, 100, 1.2, 30, 4)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions