Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • GfG 160: Daily DSA
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Tkinter
  • Pygame
  • Matplotlib
  • Python Imaging Library
  • Pyglet
  • Python
  • Numpy
  • Pandas
  • Python Database
  • Data Science With Python
  • Machine Learning with Python
  • Django
  • Flask
  • R
Open In App
Next Article:
Python Turtle Tutorial
Next article icon

Python Turtle Tutorial

Last Updated : 09 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Turtle is a Python module that provides a drawing board like feature, which enables users to create pictures and shapes. Turtle is one of the most popular ways of introducing programming to kids and is part of the original LOGO programming language.

The on-screen pen that is used for drawing is called the turtle and can be moved using the functions like turtle.forward(), turtle.left(), etc. For example turtle.forward(10) will move the pen in the forward direction by 10 pixels. Consider the below example for better understanding.

Example:

Python
import turtle

# moves the pen in the 
# forward direction by 
# 110 pixels
turtle.forward(110)

# changes the direction of 
# the pen by 10 degrees in the
# left direction
turtle.left(110)

# moves the pen in the 
# forward direction in 
# the new direction by
# 110 pixels
turtle.forward(110)
python turtle tutorial introduciton

Let's get started learning Turtle from basics to advance with the help huge dataset containing well-explained functions and exercises which are categorized properly to help you learn it in a more systematic way.

Introduction

  • Turtle Programming in Python

Programming with Turtle

Moving and Drawing with Turtle

  • turtle.backward() method in Python
  • turtle.left() method in Python
  • turtle.right() method in Python
  • turtle.setx() function in Python
  • turtle.sety() function in Python
  • turtle.seth() function in Python
  • turtle.dot() function in Python
  • turtle.home() function in Python
  • turtle.speed() function in Python
  • turtle.undo() function in Python
  • turtle.stamp() function in Python
  • turtle.clearstamp() method in Python
  • turtle.clearstamps() method in Python
  • turtle.towards() function in Python
  • turtle.heading() function in Python
  • turtle.xcor() function in Python
  • turtle.ycor() function in Python
  • turtle.degrees() function in Python
  • Python – turtle.radians()

Pen Control in Turtle

  • turtle.up() method in Python
  • turtle.down() method in Python
  • turtle.isdown() function in Python
  • turtle.width() function in Python
  • turtle.pen() function in Python
  • turtle.write() function in Python
  • turtle.color() method in Python
  • turtle.fillcolor() function in Python
  • Python – turtle.pencolor() method
  • turtle.filling() function in Python
  • turtle.begin_fill() function in Python
  • turtle.end_fill() function in Python
  • Python – turtle.clear()

Event Handling with Turtle

  • turtle.onclick() function in Python
  • turtle.onkey() function in Python
  • turtle.onscreenclick() function in Python
  • turtle.onrelease() function in Python
  • turtle.ontimer() function in Python
  • turtle.ondrag() function in Python
  • Python – turtle.exitonclick()
  • Python – turtle.done()

Working With Turtle State

  • turtle.showturtle() function in Python
  • turtle.isvisible() function in Python
  • turtle.shape() function in Python
  • turtle.turtlesize() function in Python
  • turtle.tilt() function in Python
  • turtle.shapetransform() function in Python
  • turtle.settiltangle() function in Python
  • turtle.shearfactor() function in Python
  • turtle.get_poly() function in Python
  • turtle.resizemode() function in Python
  • turtle.pos() method in Python

Working with Turtle Screen

  • turtle.reset() function in Python
  • turtle.resetscreen() function in Python
  • Python – turtle.Screen().setup() method
  • Python – turtle.clear()
  • turtle.bgpic() function in Python
  • turtle.Screen().turtles() function in Python
  • turtle.setworldcoordinates() function in Python
  • turtle.numinput() function in Python
  • turtle.textinput() function in Python
  • turtle.window_height() function in Python
  • turtle.window_width() function in Python
  • turtle.screensize() function in Python
  • turtle.title() function in Python
  • Python – turtle.done()
  • turtle.addshape() function in Python
  • turtle.colormode() function in Python
  • Python – turtle.delay() method
  • turtle.tracer() function in Python
  • turtle.mode() function in Python
  • turtle.register_shape() function in Python
  • Python – turtle.bye()

Special Turtle Methods 

  • turtle.clone() function in Python
  • turtle.undobufferentries() function in Python
  • turtle.setundobuffer() function in Python
  • turtle.getpen() function in Python
  • turtle.getshapes() function in Python
  • turtle.get_shapepoly() function in Python
  • turtle.getscreen() function in Python

Turtle Exercises and projects

Beginners

  • How to Get Coordinate Of Screen in Python Turtle ?
  • Draw Square and Rectangle in Turtle – Python
  • Draw Color Filled Shapes in Turtle – Python
  • Python – Draw Hexagon Using Turtle Graphics
  • Python – Draw Octagonal shape Using Turtle Graphics
  • Draw any polygon in Turtle – Python
  • Draw Ellipse Using Turtle in Python
  • Draw Cube and Cuboid in Python using Turtle
  • Draw Colored Solid Cube using Turtle in Python
  • Python – Draw Star Using Turtle Graphics
  • How to draw color filled star in Python-Turtle?
  • Draw Rainbow using Turtle Graphics in Python
  • Python – Write “GFG” using Turtle Graphics
  • Python – Draw “GFG” logo using Turtle Graphics
  • Draw smiling face emoji using Turtle in Python

Intermediate

  • Draw Shape inside Shape in Python Using Turtle
  • Draw an Olympic Symbol in Python using Turtle
  • Draw Concentric Circles with VIBGYOR Using Turtle in Python
  • Draw Dot Patterns Using Turtle in Python
  • Draw a car using Turtle in Python
  • Draw sun using Turtle module in Python
  • Draw Heart Using Turtle Graphics in Python
  • Draw Diamond shape using Turtle graphics in Python
  • Draw Graph Grid Using Turtle in Python
  • Draw Panda Using Turtle Graphics in Python
  • Draw house using Turtle programming in Python
  • Draw a snowman using turtle module in Python
  • Draw Clock Design using Turtle in Python
  • Create digital clock using Python-Turtle
  • Draw Colourful Star Pattern in Turtle – Python
  • Print a Spirograph using turtle in Python
  • Draw Spiraling Star using Turtle in Python
  • Draw Spiraling Square using Turtle in Python
  • Draw Spiraling Triangle using Turtle in Python
  • Draw Spiraling Polygon using Turtle in Python
  • Draw Colorful Spiral Web Using Turtle Graphics in Python
  • Draw a Tic Tac Toe Board using Python-Turtle
  • Draw Chess Board Using Turtle in Python
  • Python – Hilbert Curve using turtle
  • Turtle – Draw Lines using arrow keys
  • Draw lines at the respective positions clicked by the mouse using Turtle
  • Python Turtle – Graphics Keyboard Commands
  • How to make Triangle in Python Turtle using onscreenclick?

Advance

  • How to Create custom Turtle shapes in Python?
  • Circle of Squares using Python
  • How to draw 2-layered and colored spider web in Python using Turtle Module?
  • Y Fractal tree in Python using Turtle
  • How to make Indian Flag using Turtle – Python
  • Draw Starry Sky with Moon using Turtle in Python
  • Draw moving object using Turtle in Python
  • Create a simple Animation using Turtle in Python
  • Create a Simple Two Player Game using Turtle in Python
  • Create a Snake-Game using Turtle in Python
  • Create pong game using Python – Turtle
  • Flipping Tiles (memory game) using Python3

Next Article
Python Turtle Tutorial
author
abhishek1
Improve
Article Tags :
  • Python
  • Python-turtle
Practice Tags :
  • python

Similar Reads

  • Python Tkinter Tutorial
    Tkinter is the most commonly used library for developing GUI (Graphical User Interface) in Python. It is a standard Python interface to the Tk GUI toolkit shipped with Python. As Tk and Tkinter are available on most of the Unix platforms as well as on the Windows system, developing GUI applications
    6 min read
  • Selenium Python Tutorial
    Selenium is a powerful tool for controlling web browsers through programs and performing browser automation. It is functional for all browsers, works on all major OS and its scripts are written in various languages i.e Python , Java , C# , etc, we will be working with Python. Selenium Tutorial cover
    9 min read
  • SQLAlchemy Tutorial in Python
    This SQLAlchemy Tutorial is very well suited for beginners and also for experienced programmers. This specially designed free SQLAlchemy tutorial will help you learn SQLAlchemy most efficiently, with all topics from basics to advanced. What is SQLAlchemy?SQLAlchemy is referred to as the toolkit of P
    4 min read
  • PyGame Tutorial
    Pygame is a free and open-source library for making games and multimedia applications in Python. It helps us create 2D games by giving us tools to handle graphics, sounds and user input (like keyboard and mouse events) without needing to dig deep into complex stuff like graphics engines.Release date
    7 min read
  • OpenCV Tutorial in Python
    OpenCV, short for Open Source Computer Vision Library, is an open-source computer vision and machine learning software library. Originally developed by Intel, it is now maintained by a community of developers under the OpenCV Foundation.OpenCVis a huge open-source library for computer vision, machin
    3 min read
  • Matplotlib Tutorial
    Matplotlib is an open-source visualization library for the Python programming language, widely used for creating static, animated and interactive plots. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, Qt, GTK and wxPython. It
    5 min read
  • Python Testing
    Python testing is a fundamental aspect of software development that plays a crucial role in ensuring the reliability, correctness, and maintainability of your code. By adopting effective testing strategies, leveraging robust testing frameworks, and adhering to best practices, you can build high-qual
    15 min read
  • Python Tkinter
    Python Tkinter is a standard GUI (Graphical User Interface) library for Python which provides a fast and easy way to create desktop applications. Tkinter provides a variety of widgets like buttons, labels, text boxes, menus and more that can be used to create interactive user interfaces. Tkinter sup
    12 min read
  • NumPy Tutorial - Python Library
    NumPy (short for Numerical Python ) is one of the most fundamental libraries in Python for scientific computing. It provides support for large, multi-dimensional arrays and matrices along with a collection of mathematical functions to operate on arrays.At its core it introduces the ndarray (n-dimens
    3 min read
  • Python Variables
    In Python, variables are used to store data that can be referenced and manipulated during program execution. A variable is essentially a name that is assigned to a value. Unlike many other programming languages, Python variables do not require explicit declaration of type. The type of the variable i
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

'); // $('.spinner-loading-overlay').show(); let script = document.createElement('script'); script.src = 'https://assets.geeksforgeeks.org/v2/editor-prod/static/js/bundle.min.js'; script.defer = true document.head.appendChild(script); script.onload = function() { suggestionModalEditor() //to add editor in suggestion modal if(loginData && loginData.premiumConsent){ personalNoteEditor() //to load editor in personal note } } script.onerror = function() { if($('.editorError').length){ $('.editorError').remove(); } var messageDiv = $('
').text('Editor not loaded due to some issues'); $('#suggestion-section-textarea').append(messageDiv); $('.suggest-bottom-btn').hide(); $('.suggestion-section').hide(); editorLoaded = false; } }); //suggestion modal editor function suggestionModalEditor(){ // editor params const params = { data: undefined, plugins: ["BOLD", "ITALIC", "UNDERLINE", "PREBLOCK"], } // loading editor try { suggestEditorInstance = new GFGEditorWrapper("suggestion-section-textarea", params, { appNode: true }) suggestEditorInstance._createEditor("") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } //personal note editor function personalNoteEditor(){ // editor params const params = { data: undefined, plugins: ["UNDO", "REDO", "BOLD", "ITALIC", "NUMBERED_LIST", "BULLET_LIST", "TEXTALIGNMENTDROPDOWN"], placeholderText: "Description to be......", } // loading editor try { let notesEditorInstance = new GFGEditorWrapper("pn-editor", params, { appNode: true }) notesEditorInstance._createEditor(loginData&&loginData.user_personal_note?loginData.user_personal_note:"") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } var lockedCasesHtml = `You can suggest the changes for now and it will be under 'My Suggestions' Tab on Write.

You will be notified via email once the article is available for improvement. Thank you for your valuable feedback!`; var badgesRequiredHtml = `It seems that you do not meet the eligibility criteria to create improvements for this article, as only users who have earned specific badges are permitted to do so.

However, you can still create improvements through the Pick for Improvement section.`; jQuery('.improve-header-sec-child').on('click', function(){ jQuery('.improve-modal--overlay').hide(); $('.improve-modal--suggestion').hide(); jQuery('#suggestion-modal-alert').hide(); }); $('.suggest-change_wrapper, .locked-status--impove-modal .improve-bottom-btn').on('click',function(){ // when suggest changes option is clicked $('.ContentEditable__root').text(""); $('.suggest-bottom-btn').html("Suggest changes"); $('.thank-you-message').css("display","none"); $('.improve-modal--improvement').hide(); $('.improve-modal--suggestion').show(); $('#suggestion-section-textarea').show(); jQuery('#suggestion-modal-alert').hide(); if(suggestEditorInstance !== null){ suggestEditorInstance.setEditorValue(""); } $('.suggestion-section').css('display', 'block'); jQuery('.suggest-bottom-btn').css("display","block"); }); $('.create-improvement_wrapper').on('click',function(){ // when create improvement option clicked then improvement reason will be shown if(loginData && loginData.isLoggedIn) { $('body').append('
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status) }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ } $('.improve-modal--improvement').show(); }); const showErrorMessage = (result,statusCode) => { if(!result) return; $('.spinner-loading-overlay:eq(0)').remove(); if(statusCode == 403) { $('.improve-modal--improve-content.error-message').html(result.message); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); return; } } function suggestionCall() { var editorValue = suggestEditorInstance.getValue(); var suggest_val = $(".ContentEditable__root").find("[data-lexical-text='true']").map(function() { return $(this).text().trim(); }).get().join(' '); suggest_val = suggest_val.replace(/\s+/g, ' ').trim(); var array_String= suggest_val.split(" ") //array of words var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(editorValue.length { jQuery('.ContentEditable__root').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('
'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // script for grecaptcha loaded in loginmodal.html and call function to set the token setGoogleRecaptcha(); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('
'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status); }, }); });
"For an ad-free experience and exclusive features, subscribe to our Premium Plan!"
Continue without supporting
`; $('body').append(adBlockerModal); $('body').addClass('body-for-ad-blocker'); const modal = document.getElementById("adBlockerModal"); modal.style.display = "block"; } function handleAdBlockerClick(type){ if(type == 'disabled'){ window.location.reload(); } else if(type == 'info'){ document.getElementById("ad-blocker-div").style.display = "none"; document.getElementById("ad-blocker-info-div").style.display = "flex"; handleAdBlockerIconClick(0); } } var lastSelected= null; //Mapping of name and video URL with the index. const adBlockerVideoMap = [ ['Ad Block Plus','https://media.geeksforgeeks.org/auth-dashboard-uploads/abp-blocker-min.mp4'], ['Ad Block','https://media.geeksforgeeks.org/auth-dashboard-uploads/Ad-block-min.mp4'], ['uBlock Origin','https://media.geeksforgeeks.org/auth-dashboard-uploads/ub-blocke-min.mp4'], ['uBlock','https://media.geeksforgeeks.org/auth-dashboard-uploads/U-blocker-min.mp4'], ] function handleAdBlockerIconClick(currSelected){ const videocontainer = document.getElementById('ad-blocker-info-div-gif'); const videosource = document.getElementById('ad-blocker-info-div-gif-src'); if(lastSelected != null){ document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.backgroundColor = "white"; document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.borderColor = "#D6D6D6"; } document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.backgroundColor = "#D9D9D9"; document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.borderColor = "#848484"; document.getElementById('ad-blocker-info-div-name-span').innerHTML = adBlockerVideoMap[currSelected][0] videocontainer.pause(); videosource.setAttribute('src', adBlockerVideoMap[currSelected][1]); videocontainer.load(); videocontainer.play(); lastSelected = currSelected; }

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences