Question
Please solve for me those exercises using Python (with turtle)
Exercises: Exercise 1: Run example 4 with values for L 100, 200, and 300. Exercise 2: Change the code in exercise 1 by assign

Example 4 with graphics main.py 1. import turtle as t 100 L for i in range (1, 20): t.forward(L) t.left (90) t.forward(L) t.lthis is example 4
Exercises: Exercise 1: Run example 4 with values for L 100, 200, and 300. Exercise 2: Change the code in exercise 1 by assigning a variable to the angle. Exercise 3: Draw a bedroom using variables for length and width. Exercise 4: Identify correct data type to work on the following information. Employee Salary Student mark Product supplier address Student subject and mark Country, capital and its population
Example 4 with graphics main.py 1. import turtle as t 100 L for i in range (1, 20): t.forward(L) t.left (90) t.forward(L) t.left(90) t.forward(L) t.left(90) t.forward(L) t.left(5) 4 10 11 12 235 567 Co 9
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Exercise 1.

import turtle as t
L = 100

for i in range(1,20):
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(5)


for L = 100

X Python Turtle Graphics Spyder 13:38 ENG 11-06-2019

import turtle as t
L = 200

for i in range(1,20):
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(5)

for L = 200

X Python Turtle Graphics 13:38 ENG 11-06-2019

import turtle as t
L = 300

for i in range(1,20):
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(90)
    t.forward(L)
    t.left(5)

for L = 300

Python Turtle Graphics 13:36 ENG 11-06-2019

Exercise 2.

import turtle as t
L = 100
# L = 200
# L = 300

angle_1 = 90    # variable for first angle
angle_2 = 5     # variable for second angle

for i in range(1,20):
    t.forward(L)
    t.left(angle_1)
    t.forward(L)
    t.left(angle_1)
    t.forward(L)
    t.left(angle_1)
    t.forward(L)
    t.left(angle_2)



Note for drawing the desired value of L please uncomment them. Here for L = 100

X Python Turtle Graphics Spyder 13:38 ENG 11-06-2019

Exercise 3.

import turtle as t

length = 200    # length
width = 100     # width
angle = 90      # angle is right angle between the sides or walls of bedroom

# as we know a bedroom with a given length and width is rectangular in shape
# following line of code will print a rectangular bedroom

# draws the first side and turns right by 90
t.forward(length)
t.right(angle)

# draws the second side and turns right by 90
t.forward(width)
t.right(angle)

# draws the third side and turns right by 90
t.forward(length)
t.right(angle)

# draws the fourth side and turns right by 90
t.forward(width)
t.right(angle)


X Python Turtle Graphics 13:52 ENG 11-06-2019

Exercise 4.

  • Employee Salary - Double
  • Student mark - Integer or float
  • Product supplier address - String
  • Student subject and mark- For this, we will use a structure data type which is user-defined data type. In the structure we will declare 2 different fields, for students marks, we take integers or the float, and for the subjects we use strings.
  • Country, capital and its population- For this, we will declare the structure variable with the different data fields, for the country and its capital we take a string and for the population, we take double or long int.

For help and modification please comment.

Thank You

Add a comment
Know the answer?
Add Answer to:
Please solve for me those exercises using Python (with turtle) this is example 4 Exercises: Exercise...
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
  • Need help with a few questions! Using the JAVA language please. 1) exercises - branching Write...

    Need help with a few questions! Using the JAVA language please. 1) exercises - branching Write a method whatToWear(int temp) that takes a temperature and then outputs a string for what to wear in different weather conditions. There must be at least 3 categories. For example, whatToWear(90) might return “shorts” and whatToWear(30) might return “down coat” 2) Enum exercise • Define an enum Seasons, and rewrite the whatToWear method to use enums and switch statement 8) 2D array exercise 1....

  • can someone solve these quick please and thank you! sql chapter 4 Query #1: List the...

    can someone solve these quick please and thank you! sql chapter 4 Query #1: List the company name, contact name, contact title and the phone number for customers who HAVE NOT put in an order. Use an outer join. Query #2: Create a listing displaying the employee first name, last name and the full name (First name space Last Name) of the person they report to (Supervisor). This is a self-join. If an employee does not report to anyone then...

  • Please can you solve all that question for me? Suggestions for studying: Reviev all required readings,...

    Please can you solve all that question for me? Suggestions for studying: Reviev all required readings, lectures, notes, assignments and practice actvities. Then, go through this scenario and the following questions. Go back to your readings to fill in gaps in knowledge and understanding Scenario: Mark is a 50-year-old sedentary adult who weighs 95 kg. He goes to the doctor for a check-up. Mark's physician recommends that he increase his physical activity and suggests that Mark have a graded exercise...

  • 23.4 Project 4: Using Pandas for data analysis and practice with error handling Python Please! 23.4...

    23.4 Project 4: Using Pandas for data analysis and practice with error handling Python Please! 23.4 PROJECT 4: Using Pandas for data analysis and practice with error handling Overview In this project, you will use the Pandas module to analyze some data about some 20th century car models, country of origin, miles per gallon, model year, etc. Provided Input Files An input file with nearly 200 rows of data about automobiles. The input file has the following format (the same...

  • using C++ language!! please help me out with this homework In this exercise, you will have...

    using C++ language!! please help me out with this homework In this exercise, you will have to create from scratch and utilize a class called Student1430. Student 1430 has 4 private member attributes: lastName (string) firstName (string) exams (an integer array of fixed size of 4) average (double) Student1430 also has the following member functions: 1. A default constructor, which sets firstName and lastName to empty strings, and all exams and average to 0. 2. A constructor with 3 parameters:...

  • Lab 8: Exercises EXERCISE 8.1 GM is a 20 y/o male who was admitted to the...

    Lab 8: Exercises EXERCISE 8.1 GM is a 20 y/o male who was admitted to the ICU for severe closed head injury and multiple fractures resulting from a fighting engagement at the bar on his birthday. According to his friends, his Ht is 178 cm. His measured Wt at admission is 76 kg. His lab values were normal except for low Hgb and Hct due to bleeding (which was well controlled). He was unconscious, thus was tube fed for one...

  • PLEASE HELPING ON EXERCISE 4! THANK YOU! RELATED PROBLEMS: Exercise 4: Annual Precipitation Repeat the procedures o...

    PLEASE HELPING ON EXERCISE 4! THANK YOU! RELATED PROBLEMS: Exercise 4: Annual Precipitation Repeat the procedures of Exercises 1, 2, and 3 using the anmual precipitation totals from the Downtown Los Angeles webpage. These data can be found under the section headed "Period of Record." From there, they are located under the "Precipitation" category and Monthlhy Precipitation Listings." Use the "Monthly Totals" rather than the "Daily Extremes. (Remember, though monthly data are provided you will be working with the annual...

  • Lab Exercise #15 Assignment Overview This lab exercise provides practice with Pandas data analysis library. Data...

    Lab Exercise #15 Assignment Overview This lab exercise provides practice with Pandas data analysis library. Data Files We provide three comma-separated-value file, scores.csv , college_scorecard.csv, and mpg.csv. The first file is list of a few students and their exam grades. The second file includes data from 1996 through 2016 for all undergraduate degree-granting institutions of higher education. The data about the institution will help the students to make decision about the institution for their higher education such as student completion,...

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
ADVERTISEMENT