coding for year 7 students help them with school eeeee bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
This document provides an introduction to GUI programming using Tkinter and turtle graphics in Python. It discusses how turtle programs use Tkinter to create windows and display graphics. Tkinter is a Python package for building graphical user interfaces based on the Tk widget toolkit. Several examples are provided on how to use turtle graphics to draw shapes, add color and interactivity using keyboard and mouse inputs. GUI programming with Tkinter allows creating more complex programs and games beyond what can be done with turtle graphics alone.
The document introduces the turtle module in Python which allows users to draw pictures on a screen using a turtle. It explains how to import the turtle module, create a turtle object, and use methods like forward(), left(), right(), etc. to move the turtle and draw shapes. Some key turtle methods introduced are forward() to move the turtle forward, left()/right() to turn the turtle, reset() to clear the drawing and return to the initial position, up()/down() to lift or lower the pen. The document provides examples of using these methods to draw simple shapes like a square and demonstrates how turtle can be used to teach computer drawing concepts.
This document introduces Python turtle graphics and related math concepts. It discusses functions like forward(), left(), right(), and circle() to move and draw with the turtle. It covers angles, variables, shapes, and conditional statements. Examples show how to use these functions and concepts to draw squares, circles of different radiuses, and respond to user input with the turtle. The goal is to learn Python turtle graphics through interactive examples and exercises.
This book is intended for education and fun. Python is an amazing, text-based coding language, perfectly suited for children older than the age of 10. The Standard Python library has a module called Turtle which is a popular way to introduce programming to kids. This library enables children to create pictures and shapes by providing them with a virtual canvas. With the Python Turtle library, you can create nice animation projects using images that are taken from the internet, scaled-down stored as a gif-files download to the projects. The book includes 19 basic lessons with examples that introduce to the Python codes through Turtle library which is convenient to the school students of 10+years old. The book has also a lot of projects that show how to make different animations with Turtle graphics: games, applications to math, physics, and science.
ISTA 130 Lab 21 Turtle ReviewHere are all of the turt.docxpriestmanmable
ISTA 130: Lab 2
1 Turtle Review
Here are all of the turtle functions we have utilized so far in this course:
turtle.forward(distance) – Moves the turtle forward in the direction it is currently facing the distance
entered
turtle.backward(distance) – Same as forward but it moves in the opposite direction the turtle is facing
turtle.right(degrees) – Roates the turtle to the right by the degrees enteres
turtle.left(degrees) – Same as right, but it rotates the turtle to the left
turtle.pensize(size) – Adjusts the size of the line left by the turtle to whatever value is entered for size
turtle.home() – Moves the turtle to the default location and faces it to the right
turtle.clear() – Clears all the lines that were left by the turtle in the window.
turtle.penup() – Causes the turtle to stop leaving lines (until pen is placed back down)
turtle.pendown() – Places the pen back down to the turtle can continue leaving lines when forward and
backward are called.
turtle.pencolor(color string) – Changes the color of the lines left by the turtle to whatever color string
entered (so long as Python recognizes it).
turtle.bgcolor(color string) – Changes the background color for the window that the turtle draws in.
turtle.speed(new speed) – Changes the speed at which the turtle moves to whatever newSpeed is.
turtle.clearscreen() – Deletes all drawings and turtles from the screen, leaving it in its initial state
Note that abbreviations also exist for many of these functions; for example:
� turtle.fd(distance)
� turtle.rt(degrees)
� turtle.pu()
1
2 Functions and Parameters
Here is the square function we looked at yesterday:
def square(side_length):
’’’
Draws a square given a numerical side_length
’’’
turtle.forward(side_length)
turtle.right(90)
turtle.forward(side_length)
turtle.right(90)
turtle.forward(side_length)
turtle.right(90)
turtle.forward(side_length)
turtle.right(90)
return
square(50) # This would give side_length the value of 50
square(100) # This would give side_length the value of 100
print side_length # This will give an error because side_length
# only exists inside the function!
Try it out:
(1 pt.) Create a new file called lab02.py. In this file, create a simple function called rhombus. It
will take one parameter, side length. Using this parameter, have your function create a rhombus
using turtle graphics. Call your rhombus function in the script. What happens if you provide no
arguments to the function? Two or three arguments?
Then, modify your rhombus function so it takes another argument for the angle inside the
rhombus.
3 Data types
Python recognizes many different types of values when working with data. These can be numbers,
strings of characters, or even user defined objects. For the time being, however, were only going to
focus on three of the data types:
integer – These are whole numbers, both positive and negative. Examples are 5000, 0, and -25
float – These are numbers that are followed by a decimal poi ...
This document describes building a basic calculator program in Python. It takes user input to select an arithmetic operation (add, subtract, multiply, divide) and two numbers. If/elif/else statements direct the program to call functions to perform the selected operation and display the result. While basic, this provides a starting point to create a more advanced calculator with additional features.
This document discusses seven ways to use Python's turtle module. It begins with an introduction to the history and configuration of the turtle module. It then outlines seven ways to use the module: 1) classical turtle graphics for beginners using a procedural style, 2) using Cartesian geometry commands, 3) representing turtles as objects, and 4) using turtles as geometrical objects. Examples are provided for each approach, such as drawing shapes, simulating orbits, and representing the Towers of Hanoi game. The document emphasizes the turtle module's versatility through different programming styles and approaches to graphics.
The document discusses the Turtle module in Python, which allows users to create graphics and animations. It introduces Turtle as a library that simulates a pen or turtle moving around the screen. Popular Turtle methods are listed like forward(), backward(), right(), and left() to move the turtle and draw. The document also covers how to get turtle state information, bind events to keys, and provides an example of a simple "golf" game built with Turtle.
This document provides an introduction to Python programming and turtle graphics. It outlines 4 tasks to introduce key concepts: 1) opening Python and saving files, 2) importing turtle and using pen up/down commands, 3) creating shapes like triangles using turtle commands, and 4) using for loops to efficiently create multiple shapes. The objectives are to understand creating/saving Python programs, using variables, turtle graphics commands, and for loops.
This presentation is a part of the COP2271C college level course taught at the Florida Polytechnic University located in Lakeland Florida. The purpose of this course is to introduce Freshmen students to both the process of software development and to the Python language.
The course is one semester in length and meets for 2 hours twice a week. The Instructor is Dr. Jim Anderson.
A video of Dr. Anderson using these slides is available on YouTube at:
https://www.youtube.com/watch?feature=player_embedded&x-yt-cl=84503534&v=wj41FZyHIbk&x-yt-ts=1421914688
The document presents a student presentation on using the Python turtle module to learn basic computer graphics and shapes. It introduces the turtle as a small arrow that moves and draws on a canvas. It explains how to import the turtle module, create a canvas, and use functions like forward(), backward(), left(), right() to move the turtle and draw shapes like squares. It discusses using functions like clear() to clear the canvas and reset() to reset the turtle. It concludes by proposing programming puzzles to draw shapes using turtle functions.
Python's "batteries included" philosophy means that it comes with an astonishing amount of great stuff. On top of that, there's a vibrant world of third-party libraries that help make Python even more wonderful. We'll go on a breezy, example-filled tour through some of my favorites, from treasures in the standard library to great third-party packages that I don't think I could live without, and we'll touch on some of the fuzzier aspects of the Python culture that make it such a joy to be part of.
This document provides an overview of simple graphics using Turtle and image processing concepts. It discusses Turtle graphics, which were developed for the Logo programming language. A Turtle has attributes like position and heading that define its state. Methods can modify these attributes to draw shapes. The document also covers basic image processing concepts like analog vs. digital images, sampling, file formats, compression techniques, and common operations like filtering and resizing.
The document summarizes the internship training that Shivam Denge completed from July 5th to August 16th 2022 at iBase Technology. The 6-week online training covered topics like Python programming language features, variables, loops, data structures, Numpy, Tkinter, Turtle and MySQL database modules. Key aspects of Python like being an interpreted, object-oriented and cross-platform language were also highlighted.
The document provides an overview of a Python programming presentation on the Joy of Computing with Python. It discusses why programming is important, the importance of clear instructions, and introduces concepts like Scratch and loops. The presentation is split into 8 weeks, with topics covered including crowd computing, genetic algorithms, searching and sorting algorithms, recursion, and simulations of games like snakes and ladders and the lottery.
Lectures from a Python workshop I taught in 2013 at the University of Pittsburgh. These are introductory slides to teach important aspects of the Python language.
Update: python limits the number of recursion calls, so computing the factorial as shown in the slides may not be generally usable.
This document provides an introduction to the Python programming language. It covers basic Python concepts like data types, strings, data structures, classes, methods, exceptions, iterations, generators, and scopes. Python is described as an easy to learn, read, and use dynamic language with a large selection of stable libraries. It is presented as being much easier than bash scripts for building and maintaining complex system infrastructure.
The document describes an internship training in Python conducted over 6 weeks. It provides an introduction to Python, describing it as a general purpose programming language that can be used for various applications. It then discusses key Python features and concepts like variables, loops, data structures, modules like NumPy, Tkinter, Turtle and how to connect Python to MySQL databases. Code examples are provided to demonstrate basic usage of these features and modules.
This document summarizes a presentation on the Joy of Computing with Python. It discusses 12 weekly topics that were covered, including introduction to programming, writing first programs, searching and sorting algorithms, and recursion. Each topic is briefly outlined in 1-2 sentences. The presentation was given by Ajit Shrivas, Akshat Singh Parmar, Anshul Soni, and Himanshu Kushwah to introduce programming concepts using Python.
The document provides an overview of the course curriculum for a Python with AI session. It covers Python basics, pandas for working with datasets, REST APIs and GitHub, data visualization, and a final project. It also reviews key Python concepts like conditionals, loops, lists, dictionaries, modules, and the pandas library for reading CSV files and working with dataframes. Exercises include generating random numbers and working with lists, dictionaries, and dataframes.
Raspberry Pi - Lecture 5 Python for Raspberry PiMohamed Abdallah
Python syntax, Strings and console output, Conditional an, control flow, Functions, Lists and dictionaries, Loops, Bitwise operators, Classes, File Input/output
This document provides a summary of the main data types in Python including text, numeric, sequence, mapping, set, boolean, and binary types. It discusses the main characteristics of integers, floats, complexes, strings, lists, tuples, dictionaries, and sets. It covers how to define, access, modify, loop through and add/remove items for each data type. The key details covered include slicing strings, converting between types, appending/inserting/removing list items, immutable tuples, unordered sets and indexed dictionaries.
Here is a Python function that calculates the distance between two points given their x and y coordinates:
```python
import math
def distance_between_points(x1, y1, x2, y2):
return math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
```
To use it:
```python
distance = distance_between_points(1, 2, 4, 5)
print(distance)
```
This would print 3.605551275463989, which is the distance between the points (1,2) and (4,5).
The key steps are:
1.
The document discusses the Turtle module in Python, which allows users to create graphics and animations. It introduces Turtle as a library that simulates a pen or turtle moving around the screen. Popular Turtle methods are listed like forward(), backward(), right(), and left() to move the turtle and draw. The document also covers how to get turtle state information, bind events to keys, and provides an example of a simple "golf" game built with Turtle.
This document provides an introduction to Python programming and turtle graphics. It outlines 4 tasks to introduce key concepts: 1) opening Python and saving files, 2) importing turtle and using pen up/down commands, 3) creating shapes like triangles using turtle commands, and 4) using for loops to efficiently create multiple shapes. The objectives are to understand creating/saving Python programs, using variables, turtle graphics commands, and for loops.
This presentation is a part of the COP2271C college level course taught at the Florida Polytechnic University located in Lakeland Florida. The purpose of this course is to introduce Freshmen students to both the process of software development and to the Python language.
The course is one semester in length and meets for 2 hours twice a week. The Instructor is Dr. Jim Anderson.
A video of Dr. Anderson using these slides is available on YouTube at:
https://www.youtube.com/watch?feature=player_embedded&x-yt-cl=84503534&v=wj41FZyHIbk&x-yt-ts=1421914688
The document presents a student presentation on using the Python turtle module to learn basic computer graphics and shapes. It introduces the turtle as a small arrow that moves and draws on a canvas. It explains how to import the turtle module, create a canvas, and use functions like forward(), backward(), left(), right() to move the turtle and draw shapes like squares. It discusses using functions like clear() to clear the canvas and reset() to reset the turtle. It concludes by proposing programming puzzles to draw shapes using turtle functions.
Python's "batteries included" philosophy means that it comes with an astonishing amount of great stuff. On top of that, there's a vibrant world of third-party libraries that help make Python even more wonderful. We'll go on a breezy, example-filled tour through some of my favorites, from treasures in the standard library to great third-party packages that I don't think I could live without, and we'll touch on some of the fuzzier aspects of the Python culture that make it such a joy to be part of.
This document provides an overview of simple graphics using Turtle and image processing concepts. It discusses Turtle graphics, which were developed for the Logo programming language. A Turtle has attributes like position and heading that define its state. Methods can modify these attributes to draw shapes. The document also covers basic image processing concepts like analog vs. digital images, sampling, file formats, compression techniques, and common operations like filtering and resizing.
The document summarizes the internship training that Shivam Denge completed from July 5th to August 16th 2022 at iBase Technology. The 6-week online training covered topics like Python programming language features, variables, loops, data structures, Numpy, Tkinter, Turtle and MySQL database modules. Key aspects of Python like being an interpreted, object-oriented and cross-platform language were also highlighted.
The document provides an overview of a Python programming presentation on the Joy of Computing with Python. It discusses why programming is important, the importance of clear instructions, and introduces concepts like Scratch and loops. The presentation is split into 8 weeks, with topics covered including crowd computing, genetic algorithms, searching and sorting algorithms, recursion, and simulations of games like snakes and ladders and the lottery.
Lectures from a Python workshop I taught in 2013 at the University of Pittsburgh. These are introductory slides to teach important aspects of the Python language.
Update: python limits the number of recursion calls, so computing the factorial as shown in the slides may not be generally usable.
This document provides an introduction to the Python programming language. It covers basic Python concepts like data types, strings, data structures, classes, methods, exceptions, iterations, generators, and scopes. Python is described as an easy to learn, read, and use dynamic language with a large selection of stable libraries. It is presented as being much easier than bash scripts for building and maintaining complex system infrastructure.
The document describes an internship training in Python conducted over 6 weeks. It provides an introduction to Python, describing it as a general purpose programming language that can be used for various applications. It then discusses key Python features and concepts like variables, loops, data structures, modules like NumPy, Tkinter, Turtle and how to connect Python to MySQL databases. Code examples are provided to demonstrate basic usage of these features and modules.
This document summarizes a presentation on the Joy of Computing with Python. It discusses 12 weekly topics that were covered, including introduction to programming, writing first programs, searching and sorting algorithms, and recursion. Each topic is briefly outlined in 1-2 sentences. The presentation was given by Ajit Shrivas, Akshat Singh Parmar, Anshul Soni, and Himanshu Kushwah to introduce programming concepts using Python.
The document provides an overview of the course curriculum for a Python with AI session. It covers Python basics, pandas for working with datasets, REST APIs and GitHub, data visualization, and a final project. It also reviews key Python concepts like conditionals, loops, lists, dictionaries, modules, and the pandas library for reading CSV files and working with dataframes. Exercises include generating random numbers and working with lists, dictionaries, and dataframes.
Raspberry Pi - Lecture 5 Python for Raspberry PiMohamed Abdallah
Python syntax, Strings and console output, Conditional an, control flow, Functions, Lists and dictionaries, Loops, Bitwise operators, Classes, File Input/output
This document provides a summary of the main data types in Python including text, numeric, sequence, mapping, set, boolean, and binary types. It discusses the main characteristics of integers, floats, complexes, strings, lists, tuples, dictionaries, and sets. It covers how to define, access, modify, loop through and add/remove items for each data type. The key details covered include slicing strings, converting between types, appending/inserting/removing list items, immutable tuples, unordered sets and indexed dictionaries.
Here is a Python function that calculates the distance between two points given their x and y coordinates:
```python
import math
def distance_between_points(x1, y1, x2, y2):
return math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
```
To use it:
```python
distance = distance_between_points(1, 2, 4, 5)
print(distance)
```
This would print 3.605551275463989, which is the distance between the points (1,2) and (4,5).
The key steps are:
1.
The document discusses DevOps practices and team structures. It notes that DevOps emphasizes automation and having development teams take on operational responsibilities. Teams should be small to allow for quick decision making. Key roles include the team lead, members, service owner, reliability engineer, gatekeeper, and DevOps engineer. Coordination is needed both within and across teams to ensure integration and avoid duplication. Architectural decisions can help with cross-team coordination.
How to Manage Maintenance Request in Odoo 18Celine George
Efficient maintenance management is crucial for keeping equipment and work centers running smoothly in any business. Odoo 18 provides a Maintenance module that helps track, schedule, and manage maintenance requests efficiently.
Strengthened Senior High School - Landas Tool Kit.pptxSteffMusniQuiballo
Landas Tool Kit is a very helpful guide in guiding the Senior High School students on their SHS academic journey. It will pave the way on what curriculum exits will they choose and fit in.
*Order Hemiptera:*
Hemiptera, commonly known as true bugs, is a large and diverse order of insects that includes cicadas, aphids, leafhoppers, and shield bugs. Characterized by their piercing-sucking mouthparts, Hemiptera feed on plant sap, other insects, or small animals. Many species are significant pests, while others are beneficial predators.
*Order Neuroptera:*
Neuroptera, also known as net-winged insects, is an order of insects that includes lacewings, antlions, and owlflies. Characterized by their delicate, net-like wing venation and large, often prominent eyes, Neuroptera are predators that feed on other insects, playing an important role in biological control. Many species have aquatic larvae, adding to their ecological diversity.
Rose Cultivation Practices by Kushal Lamichhane.pdfkushallamichhame
This includes the overall cultivation practices of Rose prepared by:
Kushal Lamichhane (AKL)
Instructor
Shree Gandhi Adarsha Secondary School
Kageshowri Manohara-09, Kathmandu, Nepal
Coleoptera, commonly known as beetles, is the largest order of insects, comprising approximately 400,000 described species. Beetles can be found in almost every habitat on Earth, exhibiting a wide range of morphological, behavioral, and ecological diversity. They have a hardened exoskeleton, with the forewings modified into elytra that protect the hind wings. Beetles play important roles in ecosystems as decomposers, pollinators, and food sources for other animals, while some species are considered pests in agriculture and forestry.
IDSP is a disease surveillance program in India that aims to strengthen/maintain decentralized laboratory-based IT enabled disease surveillance systems for epidemic prone diseases to monitor disease trends, and to detect and respond to outbreaks in the early phases swiftly.....
Artificial intelligence Presented by JM.jmansha170
AI (Artificial Intelligence) :
"AI is the ability of machines to mimic human intelligence, such as learning, decision-making, and problem-solving."
Important Points about AI:
1. Learning – AI can learn from data (Machine Learning).
2. Automation – It helps automate repetitive tasks.
3. Decision Making – AI can analyze and make decisions faster than humans.
4. Natural Language Processing (NLP) – AI can understand and generate human language.
5. Vision & Recognition – AI can recognize images, faces, and patterns.
6. Used In – Healthcare, finance, robotics, education, and more.
Owner By:
Name : Junaid Mansha
Work : Web Developer and Graphics Designer
Contact us : +92 322 2291672
Email : [email protected]
How to Manage Allocations in Odoo 18 Time OffCeline George
Allocations in Odoo 18 Time Off allow you to assign a specific amount of time off (leave) to an employee. These allocations can be used to track and manage leave entitlements for employees, such as vacation days, sick leave, etc.
RE-LIVE THE EUPHORIA!!!!
The Quiz club of PSGCAS brings to you a fun-filled breezy general quiz set from numismatics to sports to pop culture.
Re-live the Euphoria!!!
QM: Eiraiezhil R K,
BA Economics (2022-25),
The Quiz club of PSGCAS
Pests of Rice: Damage, Identification, Life history, and Management.pptxArshad Shaikh
Rice pests can significantly impact crop yield and quality. Major pests include the brown plant hopper (Nilaparvata lugens), which transmits viruses like rice ragged stunt and grassy stunt; the yellow stem borer (Scirpophaga incertulas), whose larvae bore into stems causing deadhearts and whiteheads; and leaf folders (Cnaphalocrocis medinalis), which feed on leaves reducing photosynthetic area. Other pests include rice weevils (Sitophilus oryzae) and gall midges (Orseolia oryzae). Effective management strategies are crucial to minimize losses.
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfChalaKelbessa
This is Forestry Exit Exam Model for 2025 from Department of Forestry at Wollega University, Gimbi Campus.
The exam contains forestry courses such as Dendrology, Forest Seed and Nursery Establishment, Plantation Establishment and Management, Silviculture, Forest Mensuration, Forest Biometry, Agroforestry, Biodiversity Conservation, Forest Business, Forest Fore, Forest Protection, Forest Management, Wood Processing and others that are related to Forestry.
HOW YOU DOIN'?
Cool, cool, cool...
Because that's what she said after THE QUIZ CLUB OF PSGCAS' TV SHOW quiz.
Grab your popcorn and be seated.
QM: THARUN S A
BCom Accounting and Finance (2023-26)
THE QUIZ CLUB OF PSGCAS.
This presentation has been made keeping in mind the students of undergraduate and postgraduate level. To keep the facts in a natural form and to display the material in more detail, the help of various books, websites and online medium has been taken. Whatever medium the material or facts have been taken from, an attempt has been made by the presenter to give their reference at the end.
In the seventh century, the rule of Sindh state was in the hands of Rai dynasty. We know the names of five kings of this dynasty- Rai Divji, Rai Singhras, Rai Sahasi, Rai Sihras II and Rai Sahasi II. During the time of Rai Sihras II, Nimruz of Persia attacked Sindh and killed him. After the return of the Persians, Rai Sahasi II became the king. After killing him, one of his Brahmin ministers named Chach took over the throne. He married the widow of Rai Sahasi and became the ruler of entire Sindh by suppressing the rebellions of the governors.
Available for Weekend June 6th. Uploaded Wed Evening June 4th.
Topics are unlimited and done weekly. Make sure to catch mini updates as well. TY for being here. More upcoming this summer.
A 8th FREE WORKSHOP
Reiki - Yoga
“Intuition” (Part 1)
For Personal/Professional Inner Tuning in. Also useful for future Reiki Training prerequisites. The Attunement Process. It’s all about turning on your healing skills. See More inside.
Your Attendance is valued.
Any Reiki Masters are Welcomed
More About:
The ‘Attunement’ Process.
It’s all about turning on your healing skills. Skills do vary as well. Usually our skills are Universal. They can serve reiki and any relatable Branches of Wellness.
(Remote is popular.)
Now for Intuition. It’s silent by design. We can train our intuition to be bold or louder. Intuition is instinct and the Senses. Coded in our Workshops too.
Intuition can include Psychic Science, Metaphysics, & Spiritual Practices to aid anything. It takes confidence and faith, in oneself.
Thank you for attending our workshops.
If you are new, do welcome.
Grad Students: I am planning a Reiki-Yoga Master Course. I’m Fusing both together.
This will include the foundation of each practice. Both are challenging independently. The Free Workshops do matter. They can also be downloaded or Re-Read for review.
My Reiki-Yoga Level 1, will be updated Soon/for Summer. The cost will be affordable.
As a Guest Student,
You are now upgraded to Grad Level.
See, LDMMIA Uploads for “Student Checkin”
Again, Do Welcome or Welcome Back.
I would like to focus on the next level. More advanced topics for practical, daily, regular Reiki Practice. This can be both personal or Professional use.
Our Focus will be using our Intuition. It’s good to master our inner voice/wisdom/inner being. Our era is shifting dramatically. As our Astral/Matrix/Lower Realms are crashing; They are out of date vs 5D Life.
We will catch trickster
energies detouring us.
(See Presentation for all sections, THX AGAIN.)
2. The turtle MODULE
Python allows you to import extra modules,
specifically written for Python users.
One of them is called turtle. You must import it
to use it. You can then open a graphics window.
import turtle # so we can use
the turtles library of commands
win = turtle.Screen()
# creates a graphics window
3. The Turtle CLASS
A Turtle is an example of class. ( turtle.Turtle())
When you create a new turtle it is called an
INSTANCE. You can also call it an OBJECT.
import turtle
win = turtle.Screen()
#make an instance of a turtle and we
will call it delia
delia = turtle.Turtle()
4. Turtle attributes
Now you have an object called delia, you can
give the turtle unique characteristics or
ATTRIBUTES like shape and speed.
The list of attributes you give to the
Turtle will make delia a unique
turtle.
7. from turtle import *
color('red', 'yellow')
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
done()
import turtle
skk = turtle.Turtle()
for i in range(4):
skk.forward(50)
skk.right(90)
turtle.done()
8. star = turtle.Turtle()
star.right(75)
star.forward(100)
for i in range(4):
star.right(144)
star.forward(100)
turtle.done()
wn = turtle.Screen()
wn.bgcolor("light green")
skk = turtle.Turtle()
skk.color("blue")
def sqrfunc(size):
for i in range(4):
skk.fd(size)
skk.left(90)
size = size + 5
sqrfunc(6)
sqrfunc(26)
sqrfunc(46)
sqrfunc(66)
sqrfunc(86)
sqrfunc(106)
sqrfunc(126)
sqrfunc(146)
9. Class Task
• Create two instances of a turtle.
• Call them delia and arthur.
• delia is to go to position (50,50) and draw a square with
that as centre. She then has to go to these 3 points,
without leaving a trail, and stamp the 3 points …(-30,30),
(100,-50), (0,0)
• arthur is to draw two circles. One of radius 50 centre(0,0) and
another of radius 40 centre (100,-50). Also the circles are to be
filled with colours.
10. Challenge
• Ask the user for the coordinates of the centre of a
circle, a radius and a fill colour.
• Get these properties for both delia and arthur
and instruct them to draw the circles.
• Finish with a stamp on the centre.
• Write on each circle the properties given by the user.
• For example “This is a red circle, centre (30,-30) and radius 45.”