INTRODUCTION TO
PYTHON:
Grade 10
WHAT IS PYTHON ?
• Python is a popular programming language, was designed for
readability, and has some similarities to the English language
• It is used for:
• web development (server-side),
• software development
• Mathematics and system scripting
PYTHON QUICKSTART
• Python is an interpreted programming language, this means that
as a developer you write Python (.py) files in a text editor and
then put those files into the python interpreter to be executed
• Let's write our first Python file, called [Link], which can be
done in any text editor
PYTHON FUNCTIONS:
The print() Function prints the specified message to the screen, or other standard
output device
Example:
-print("Hello, World!")
The output should be: Hello, World!
A QUICK QUESTION!?
• What is the correct file extension for Python files?
I. .pp
II. .pt
III. .py
PYTHON COMMENTS
• Comments can be used to explain Python code, make the code more
readable and prevent execution when testing code
• Comments starts with a #, and Python will ignore them:
• To add a multiline comment, you could insert a # for each line:
• #This is a comment
#written in
#more than just one line
print("Hello, World!")
EXERCISE
• Which character is used to define a Python comment?
I. “
II. //
III. #
IV. /*
CREATING VARIABLES
• Python has no command for declaring a variable.
• A variable is created the moment you first assign a value to it
• Example:
x=5
y = "John"
print(x)
print(y)
EXERCISE
• What is a correct way to declare a Python variable?
I. Var x =5
II. # x = 5
III. X = 5
IV. / x = 5