https://github.com/parvathy-vijayan/learn-turtle-for-beginners
Turtle is a Python feature like a drawing board, which lets us command a turtle to draw different shapes using certain functions like forward(), right(), left() etc.
https://github.com/parvathy-vijayan/learn-turtle-for-beginners
python python-turtle-graphics turtle turtle-graphics turtle-library
Last synced: about 1 year ago
JSON representation
Turtle is a Python feature like a drawing board, which lets us command a turtle to draw different shapes using certain functions like forward(), right(), left() etc.
- Host: GitHub
- URL: https://github.com/parvathy-vijayan/learn-turtle-for-beginners
- Owner: PARVATHY-VIJAYAN
- Created: 2023-06-27T00:38:29.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T06:35:16.000Z (almost 3 years ago)
- Last Synced: 2025-02-04T19:45:57.074Z (over 1 year ago)
- Topics: python, python-turtle-graphics, turtle, turtle-graphics, turtle-library
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Learn-Turtle-for-Beginners
Here I will introduce a module that allows us to create a data object called a turtle that can be used to draw pictures and different shapes using certain functions like forward(), right(), left() etc.
-
Here are some basic methods:
- left()
- right()
- forward()
- Attributes:
- color -default black
- bgcolor
- heading
- position - 0,0
- pensize(width)
Now just understand what these methods does:
left(90) ---> means our virtual turtle will turn 90 degrees to left from its current position which is considered as 0 degrees.
right(90) ---> means our virtual turtle will turn 90 degrees to right from its current position.
forward(150)---> means our virtual turtle will move forward 150 pixel
Now understand the code given below :
import turtle # allows us to use the turtles library.This line imports the module called turtle, which has all the built in functions for drawing on the screen with the Turtle object.
wn = turtle.Screen() # creates a graphics window
alex = turtle.Turtle() # create a turtle named alex
alex.forward(150) # tell alex to move forward by 150 units
alex.left(90) # turn by 90 degrees
alex.forward(75) # tell alex to move forward by 75 units
Turtle starts out facing east.
Ok guys now run the above code to understand more functions and attributes of turtle library.