Learn Python - For Beginners
Learn Python - For Beginners
Version 1.1
1|Page
Contents
Learn Python - For Beginners .............................................................................................. 1
Learn Python - For Beginners .............................................................................................. 2
Introduction to Python Programming ........................................................................... 3
Python: The Beginner-Friendly Language .................................................................... 3
What You'll Learn .............................................................................................................. 3
Why Learn Python? ............................................................................................................... 3
How to Install Python .......................................................................................................... 3
Python 3: The Future of Python ....................................................................................... 4
Download Python 3 .......................................................................................................... 4
Setting Up Python and a Text Editor .............................................................................. 4
Installing Python 3 ............................................................................................................ 4
Choosing a Text Editor .................................................................................................... 5
Creating Our First Python Program ................................................................................ 5
Using Python to Draw Shapes on the Screen .............................................................. 6
Printing on the Screen ..................................................................................................... 6
Drawing a Triangle Shape............................................................................................... 6
Running the Code .............................................................................................................. 7
2|Page
Learn Python - For Beginners
I'm excited to be teaching you Python and can't wait for you to get started in this
course.
3|Page
Download Python 2.7.14 (the latest version of Python 2)
There are two major versions of Python currently in use: Python 2 and Python 3.
Python 2 is a legacy version that's no longer officially maintained or supported, while
Python 3 is the newest version that's getting actively maintained and supported.
While Python 2 has been around longer and has more libraries and code written for
it, Python 3 is the future of Python and has many advantages. Ultimately, it's up to
you to decide which version to download.
Download Python 3
To get started, download Python 3. Although there are some differences between
Python 3 and Python 2 in terms of syntax and minor details, if you learn Python 3,
you will be able to code in Python 2 as well. Python 3 is the best version for beginners
to learn.
Click on the "Download Python 3" button and wait for the download to finish. Once
it's done, head over to your downloads folder and double-click on the downloaded
file. You will be prompted with a Python installer. Click through the installer to
complete the installation.
Installing Python 3
To install Python 3 on your computer, follow these steps:
4|Page
Choosing a Text Editor
We recommend using an IDE to write Python code, and PyCharm is a great option.
Follow these steps to download and install PyCharm:
print("Hello World")
5|Page
This program will simply print the words "Hello World" to the console when executed.
To write a basic Python program, we will use the print function to output "Hello
World" to the screen. Here's how:
print("Hello World")
When we run this program, it will print "Hello World" to the console. The print
statement is a built-in Python function that outputs text to the console.
Python programming involves giving the computer a set of instructions, which it will
execute. We can use a text editor to write Python code, and when we save the file
with a .py extension, we can execute it using a Python interpreter.
print("Hello, world!")
This will print the text "Hello, world!" onto the screen.
print("/
\ \
\ \\
\ \\\
\ \\\\
\_\\\_\\_
")
This will draw a triangle shape that looks like this:
6|Page
/ \ \ \ \ \_\_\_\
Running the Code
To run the code, we can either click the "Run App" button or the play button in
PyCharm. When the code is executed, it will output the result in the console. We can
use the print statement to output information to the console and see what our
program is doing.
By using Python code, we can draw any shape we want as long as we specify it inside
the print statements.
--------------------------------------------------- END------------------------------------------------------------------
7|Page