Draw Colored Solid Cube using Turtle in Python Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Turtle is an inbuilt module in Python. It provides: Drawing using a screen (cardboard).Turtle (pen). To draw something on the screen, we need to move this turtle (pen) and to move the turtle(pen), there are some functions like the forward(), backward(), etc. Prerequisite: Turtle Programming Basics Drawing Colored Solid Cube In this section, we will discuss how to draw a solid cube. Approach: Import turtleSet window screenSet color of turtleForm a face of cubeFill the colorRepeat step 3, 4 and 5 for two another faces. Code: python3 # Draw color-filled solid cube in turtle # Import turtle package import turtle # Creating turtle pen pen = turtle.Turtle() # Size of the box x = 120 # Drawing the right side of the cube def right(): pen.left(45) pen.forward(x) pen.right(135) pen.forward(x) pen.right(45) pen.forward(x) pen.right(135) pen.forward(x) # Drawing the left side of the cube def left(): pen.left(45) pen.forward(x) pen.left(135) pen.forward(x) pen.left(45) pen.forward(x) pen.left(135) pen.forward(x) # Drawing the top side of the cube def top(): pen.left(45) pen.forward(x) pen.right(90) pen.forward(x) pen.right(90) pen.forward(x) pen.right(90) pen.forward(x) pen.right(135) pen.forward(x) # Set the fill color to # red for the right side pen.color("red") # Start filling the color pen.begin_fill() right() # Ending the filling of the color pen.end_fill() # Set the fill color to # blue for the left side pen.color("blue") # Start filling the color pen.begin_fill() left() # Ending the filling of the color pen.end_fill() # Set the fill color to #green for the top side pen.color("green") # Start filling the color pen.begin_fill() top() # Ending the filling of the color pen.end_fill() Output : Comment More infoAdvertise with us Next Article Must Do Coding Questions - Topic-wise D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Python-projects Practice Tags : python Similar Reads Interview PreparationInterview Preparation For Software DevelopersMust Coding Questions - Company-wise Must Do Coding Questions - Topic-wiseCompany-wise Practice ProblemsCompany PreparationCompetitive ProgrammingSoftware Design-PatternsCompany-wise Interview ExperienceExperienced - Interview ExperiencesInternship - Interview ExperiencesPractice @GeeksforgeeksProblem of the DayTopic-wise PracticeDifficulty Level - SchoolDifficulty Level - BasicDifficulty Level - EasyDifficulty Level - MediumDifficulty Level - HardLeaderboard !!Explore More...Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvance Data StructuresMatrixStringAll Data StructuresAlgorithmsAnalysis of AlgorithmsSearching AlgorithmsSorting AlgorithmsPattern SearchingGeometric AlgorithmsMathematical AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide & ConquerBacktrackingBranch & BoundAll AlgorithmsProgramming LanguagesCC++JavaPythonC#Go LangSQLPHPScalaPerlKotlinWeb TechnologiesHTMLCSSJavaScriptBootstrapTailwind CSSAngularJSReactJSjQueryNodeJSPHPWeb DesignWeb BrowserFile FormatsComputer Science SubjectsOperating SystemsDBMSComputer NetworkComputer Organization & ArchitectureTOCCompiler DesignDigital Elec. & Logic DesignSoftware EngineeringEngineering MathematicsData Science & MLComplete Data Science CourseData Science TutorialMachine Learning TutorialDeep Learning TutorialNLP TutorialMachine Learning ProjectsData Analysis TutorialTutorial LibraryPython TutorialDjango TutorialPandas TutorialKivy TutorialTkinter TutorialOpenCV TutorialSelenium TutorialGATE CSGATE CS NotesGate CornerPrevious Year GATE PapersLast Minute Notes (LMNs)Important Topic For GATE CSGATE CoursePrevious Year Paper: CS exams Like