Turtle Graphics is a Python feature like a drawing board, which lets us command a turtle to draw all over it! We can use functions like penup(), pendown() pensize(..), forward (.….), right(.….), color(….), fill(…), etc. which can control the drawing, move the turtle around, and make the proper coloring and filling. Commonly used turtle methods are found in the posted pdf file “turtle – Turtle graphics Python 3.7.1rc1 documentation" To make use of the turtle methods and functionalities, we need to import turtle. "turtle" comes packed with the standard Python package and need not be installed externally. The roadmap for executing a turtle program follows 3 steps: 1. Import the turtle module 2. Create a turtle to control. 3. Draw around using the turtle methods. Problem: a- Write a function setPos(x,y), that sets the position of the turtle to the coordinates x and y (variables) without leaving any trace. b- Write a function hexagon(0, that draws a hexagon filled with yellow color and with a blue border. Each side is of 50 units. c- Write a function square(), that draws a square filled with red color and with a black border. Each side is of 90 units. d- Based on what you have learned in this course and using the appropriate commands, you are asked to implement a python program that draws the below diagram using the turtle, the functions that you have written, and in an iterative way with the proper indentation between the lines as shown in the below diagram.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Python programming: Using Turtle Graphics, Three functions to be developed.

Turtle Graphics is a Python feature like a drawing board, which lets us command a turtle to
draw all over it! We can use functions like penup(), pendown() pensize(..), forward (...),
right(...), color(...), fill(…), etc. which can control the drawing, move the turtle around, and
make the proper coloring and filling.
Commonly used turtle methods are found in the posted pdf file "turtle – Turtle graphics –
Python 3.7.1rc1 documentation"
To make use of the turtle methods and functionalities, we need to import turtle. "turtle" comes
packed with the standard Python package and need not be installed externally. The roadmap
for executing a turtle program follows 3 steps:
1. Import the turtle module
2. Create a turtle to control.
3. Draw around using the turtle methods.
Problem:
a- Write a function setPos(x,y), that sets the position of the turtle to the coordinates x
and y (variables) without leaving any trace.
b- Write a function hexagon(, that draws a hexagon filled with yellow color and with a
blue border. Each side is of 50 units.
c- Write a function square(), that draws a square filled with red color and with a black
border. Each side is of 90 units.
d- Based on what you have learned in this course and using the appropriate commands,
you are asked to implement a python program that draws the below diagram using the
turtle, the functions that you have written, and in an iterative way with the proper
indentation between the lines as shown in the below diagram.
Transcribed Image Text:Turtle Graphics is a Python feature like a drawing board, which lets us command a turtle to draw all over it! We can use functions like penup(), pendown() pensize(..), forward (...), right(...), color(...), fill(…), etc. which can control the drawing, move the turtle around, and make the proper coloring and filling. Commonly used turtle methods are found in the posted pdf file "turtle – Turtle graphics – Python 3.7.1rc1 documentation" To make use of the turtle methods and functionalities, we need to import turtle. "turtle" comes packed with the standard Python package and need not be installed externally. The roadmap for executing a turtle program follows 3 steps: 1. Import the turtle module 2. Create a turtle to control. 3. Draw around using the turtle methods. Problem: a- Write a function setPos(x,y), that sets the position of the turtle to the coordinates x and y (variables) without leaving any trace. b- Write a function hexagon(, that draws a hexagon filled with yellow color and with a blue border. Each side is of 50 units. c- Write a function square(), that draws a square filled with red color and with a black border. Each side is of 90 units. d- Based on what you have learned in this course and using the appropriate commands, you are asked to implement a python program that draws the below diagram using the turtle, the functions that you have written, and in an iterative way with the proper indentation between the lines as shown in the below diagram.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education