You are on page 1of 23

1

• P r o g r a m m i n g a n d R o b o ti c s C l u b
IHSB PRC

Python 3.8.3
Installing Python
2

Open your browser and type “https://www.python.org/” and click on


downloads
IHSB PRC
Installing Python
3

Click on the download button and download Python 3.8.3


IHSB PRC
Installing Python
4

Double click on the file you downloaded


IHSB PRC

After that, click


here

Make sure there


are tick marks
here!!
Installing Python
5

After that you should see something like this. Once you see this, click
on close
IHSB PRC
Installing a code editor
6

Just like we need Microsoft Word to edit a


word document, we use a code editor
to edit python code.
IHSB PRC

Open you browser and type


“https://www.jetbrains.com/pycharm/”

Click on the download button


Installing a code editor
7

Click on the download button for the


“Community version”
IHSB PRC
Installing a code editor
8

Double click on the file you downloaded and complete the installation
IHSB PRC
Installing a code editor
9

Make sure the following options are ticked. Then, simply click on next
and install
IHSB PRC
Installing a code editor
10

Choose the option “I want to manually reboot later” and click on


finish
IHSB PRC
Getting Started…
11

Open the PyCharm and agree to any terms and conditions. Select a
theme and click on the “Start using PyCharm” button
IHSB PRC
Getting started…
12

Click on the “Create new project” button and follow my instructions!


IHSB PRC
Why learn a programming language?
13

Some more statistics:


• Out of 7.8 billion people in the world only 26.4 million people know
how to code!
IHSB PRC

• That is only 0.33% of the global population!


Why learn a programming language?
14

Some statistics:

• 1.5 billion websites in the world (1.5,000,000,000)


IHSB PRC

• 5.5 million mobile apps world wide with a collective download of


more than 178 billion (178,000,000,000)
• More than 2 billion active computers worldwide (2,000,000,000)
• More than 3.5 billion smartphone users (3.5,000,000,000)
• More than 22 billion smart devices in the world (22,000,000,000)
Why learn a programming language?
15

1. Coding develops structured and creative thinking!


2. Programming makes things easy for you
3. Learning to program teaches you persistence
IHSB PRC

In this world surrounded and ruled by technology, being able to speak


the language of computers will make you seem like a superhero.

Coding is the new superpower!


IHSB PRC
???
16
Guido van rossum
17
IHSB PRC
Why learn Python?
18

There are 700 programming languages in the world!

You don’t need to learn all of them! You only need to learn 1 or 2 very
IHSB PRC

well.

We chose Python simply because its easy to learn, powerful and


understandable.

We can perform tasks related to machine learning and artificial


intelligence
Plan B – You can code python online
19

Simply go to the website:


https://www.programiz.com/python-programming/online-compiler/
Write your code
IHSB PRC

on the left hand


side and click
“Run” to see the
result on the right
hand side
Task - 1
20

Use the “print” command to print your name, id, section and favorite
color on different lines as shown below:
IHSB PRC
Task - 2
21

The target of this exercise is to create a string, an integer, and a floating point number. The string
should be named mystring and should contain the word "hello". The floating point number should
be named myfloat and should contain the number 10.0, and the integer should be named myint
and should contain the number 20.
IHSB PRC

# change this code


mystring = None
myfloat = None
myint = None
# testing code
if mystring == "hello":
print("String: %s" % mystring)
if isinstance(myfloat, float) and myfloat == 10.0:
print("Float: %f" % myfloat)
if isinstance(myint, int) and myint == 20:
print("Integer: %d" % myint)
Task - 3
22

In this exercise, you will need to add numbers and strings to the correct lists using the "append"
list method. You must add the numbers 1,2, and 3 to the "numbers" list, and the words 'hello'
and 'world' to the strings variable.
You will also have to fill in the variable second_name with the second name in the names list,
IHSB PRC

using the brackets operator []. Note that the index is zero-based, so if you want to access the
second item in the list, its index will be 1.
numbers = []
strings = []
names = ["John", "Eric", "Jessica"]
# write your code here
second_name = None
# this code should write out the filled arrays and the second name in the names list (Eric).
print(numbers)
print(strings)
print("The second name on the names list is %s" % second_name)
Task - 4
23

The target of this exercise is to create two lists called x_list and y_list, which contain 10 instances of the variables x
and y, respectively. You are also required to create a list called big_list, which contains the variables x and y, 10
times each, by concatenating the two lists you have created.

x = object()
IHSB PRC

y = object()
# TODO: change this code
x_list = [x]
y_list = [y]
big_list = []
print("x_list contains %d objects" % len(x_list))
print("y_list contains %d objects" % len(y_list))
print("big_list contains %d objects" % len(big_list))
# testing code
if x_list.count(x) == 10 and y_list.count(y) == 10:
print("Almost there...")
if big_list.count(x) == 10 and big_list.count(y) == 10:
print("Great!")

You might also like