0% found this document useful (0 votes)
39 views8 pages

Grade 5

Python's turtle module allows you to control a turtle cursor to draw shapes and designs on a canvas. You can import turtle, create a turtle object, and write code to direct the turtle's movements and properties like color. This enables interactive graphics creation that is often used for teaching programming concepts.

Uploaded by

Parminder Sahni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views8 pages

Grade 5

Python's turtle module allows you to control a turtle cursor to draw shapes and designs on a canvas. You can import turtle, create a turtle object, and write code to direct the turtle's movements and properties like color. This enables interactive graphics creation that is often used for teaching programming concepts.

Uploaded by

Parminder Sahni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

NOTES

GRADE 5

HISTORY OF PYTHON LANGUAGE

Python's history spans several decades, beginning in the late 1980s with its inception and

continuing to the present day as a widely used and influential programming language. Here are

some key milestones in the history of Python:

● 1980s: Python's development began in the late 1980s when Guido van Rossum was
looking for a hobby project during the Christmas holidays. He started working on Python
as a successor to the ABC programming language, aiming to create a simple and
easy-to-use scripting language.
● 1991: Python 0.9.0 was officially released in February 1991. This first version included
features such as exception handling, functions, and classes.
● 1994: Python 1.0 was released, introducing new features like lambda, map, filter, and
reduce functions.
● 2000: Python 2.0 was released in October 2000. This version introduced list
comprehensions, garbage collection, and support for Unicode.
● 2008: Python 3.0 was released in December 2008, marking a major change in the
language. Python 3 was designed to fix inconsistencies and improve features from
Python 2, including changes in string handling and division. Python 2 and 3 are not fully
compatible, so developers need to consider which version they use.
● 2010s: Python's popularity grew significantly during this decade, particularly in the fields
of data science, machine learning, and web development. Python's simplicity and
extensive library support made it a preferred choice for these applications.
● 2020: Python 2 reached its end of life on January 1, 2020, and support for it was
discontinued. Python 3 became the standard version and is the focus of ongoing
development.

Throughout its history, Python has continued to evolve with input from its active and supportive

community. The language has maintained its reputation for simplicity and readability while
incorporating modern programming features. Its rich standard library and vast ecosystem of

third-party packages make it one of the most popular programming languages today.

Python was invented by Guido van Rossum, a Dutch programmer. He began working on

the language in late 1980s as a successor to the ABC programming language and

officially released Python's first version, Python 0.9.0, in February 1991. Guido van

Rossum is known as Python's "Benevolent Dictator For Life" (BDFL) because he guided

the language's development for many years. He stepped down from this role in 2018, but

his work and influence have had a lasting impact on the language and its community.

PYTHON
Python is a high-level, interpreted programming language known for its simplicity, readability, and

versatility. It was created by Guido van Rossum and first released in 1991. Python is designed to be

easy to understand and write, making it a popular language for beginners and experienced

developers alike.

Some key features of Python include:

● Readability: Python's syntax is clean and easy to read, which helps reduce the complexity of
code.
● Interpreted: Python code is executed line by line at runtime, which makes development and
debugging easier.
● Dynamic Typing: Variables in Python can change their data type at runtime, providing
flexibility in code.
● Rich Standard Library: Python includes a comprehensive standard library that provides tools
for various tasks such as file handling, networking, and data manipulation.
● Cross-Platform: Python runs on various platforms including Windows, macOS, and Linux,
making it a versatile language for development.
● Extensive Community and Ecosystem: Python has a large and active community, with many
libraries and frameworks available for various applications such as web development, data
science, machine learning, and more.
Python is widely used in fields such as web development, data science, artificial intelligence,

scientific computing, and automation. Its ease of use and powerful capabilities make it a

popular choice for developers across different industries.

TURTLE
Turtle is a module in Python that provides a way to draw and create graphics using a turtle-like

cursor on a canvas. The name "turtle" comes from the way it works: you can imagine the cursor

as a small turtle that moves around a 2D space, leaving a trail as it moves.

The module allows you to create shapes, patterns, and designs by moving the turtle around and

telling it when to draw lines. It also supports features such as changing the color of the turtle

and its path, as well as the ability to control the speed at which the turtle moves.

The turtle module is often used as a fun and educational way to introduce programming and

graphics concepts, particularly to beginners and children.

CODE 1
# Import turtle
import turtle
# Creating a turtle object(pen)
t = turtle.Turtle()
t.shape("turtle")
#t.shape("triangle")
#t.shape("square")
#t.shape("classic")
#t.shape("arrow")
#t.shape("circle")
turtle.done()

CODE 2

import turtle
t=turtle.Turtle()
t.shape("turtle")
t.circle(100) #drawing a circle
turtle.done()

CODE 3

import turtle
t=turtle.Turtle()
t.shape("turtle")#circle, square,arrow etc
t.color("red") #changing the color of the turtle
t.circle(50)
t=turtle.Turtle()
t.shape("square")#circle, square,arrow etc
t.color("blue") #changing the color of the turtle
t.circle(70)
t=turtle.Turtle()
t.shape("arrow")#circle, square,arrow etc
t.color("orange") #changing the color of the turtle
t.circle(90)
turtle.done()

CODE 4

import turtle
t=turtle.Turtle()
t.shape("turtle")#circle, square,arrow etc
t.color("red") #changing the color of the turtle
t.circle(50)
t=turtle.Turtle()
t.shape("square")#circle, square,arrow etc
t.color("blue") #changing the color of the turtle
t.circle(70)
t=turtle.Turtle()
t.shape("arrow")#circle, square,arrow etc
t.color("orange") #changing the color of the turtle
t.circle(90)
turtle.done()

CODE 5

import turtle
t=turtle.Turtle()
t.shape("turtle")
t.color("violet")
t.circle(20)
t.color("indigo")
t.circle(25)
t.color("blue")
t.circle(30)
t.color("green")
t.circle(35)
t.color("yellow")
t.circle(40)
t.color("orange")
t.circle(45)
t.color("red")
t.circle(50)
input.done()

QUESTION: WHAT IS TURTLE?


The Python turtle module is a library that allows you to create graphics and drawings using a

turtle-like cursor on a canvas. The cursor can be directed to move around, draw lines, and

create shapes or patterns. It is a popular tool for teaching programming and introducing

graphical concepts to beginners. With turtles, you can control the cursor's movements,

colors, and shapes to create interactive designs.

QUESTION: WHAT IS GRAPHICS?


Graphics refers to visual representations of data, information, or artistic expressions. It

encompasses a wide range of forms, including:

● Computer Graphics: The creation and manipulation of visual content using

computer software. This includes 2D and 3D images, animations, and visual

effects.
QUESTION: WHAT IS CONSOLE?
In the context of the Python turtle module, the console (or command line) is where you
execute Python code that uses the turtle module to create graphics. When you run your
Python script, the console displays text output such as errors, warnings, or print
statements from your code. It is also where you provide input or run commands to
manipulate the turtle graphics window. The console serves as the interface between the
Python interpreter and the turtle program, allowing you to interact with and control the
graphical window.

QUESTION: WHAT IS CANVAS?


In Python, a canvas refers to the graphical area within a window where you can draw
shapes, images, and text using libraries such as Tkinter. It provides a surface for
creating visual elements and is often used for building graphical user interfaces (GUIs)
and visualizations.

QUESTION: WHAT IS REPL?


In the context of programming, a REPL (Read-Eval-Print Loop) is an interactive
programming environment where you can enter code, have it evaluated, and see the
output immediately. The process involves:

● Read: Reading a line of code or input from the user.


● Eval: Evaluating the code or input to execute it.
● Print: Printing the result of the evaluation for the user to see.
● Loop: Repeating the process of reading, evaluating, and printing in a loop.

REPLs are useful for testing small code snippets, experimenting with programming
languages, and debugging code interactively. Most programming languages, including
Python, have a REPL environment available for use.

You might also like