0% found this document useful (0 votes)
11 views

Class001_ Introduction to Python

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Class001_ Introduction to Python

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Session Code CODR-912-BC-001

Module Basic

Teaching Unit Introduction to Python

Learning Outcome Installing Python, Using IDLE, Print function,


Mathematical Operators

Resources Teacher:
1. Laptop along with audio and video
exchange
2. Notebook and Pen(To note any
development from session)
Student Resources
1. Laptop along with audio and video
exchange
2. Notebook and Pen(To keep note of
important parts in the session)

Duration 50 Mins

Structure Warm-up 2 Mins


Pace-up Activity 5 Mins
Knowledge Transfer 10 Mins
Student Led Activity 20 Mins
Short Quiz 8 Mins
Heads up tip for next class 5 Mins

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
1
Step Say Perform

Warm up Hi s​ tudent name​, ​how are you? Try to make the


(2 Mins) Are you excited for the class? student speak.
Do you remember the last class? Engage with the
student in
conversation.

Interaction In the last class, we made a simple console


(5 Mins) game in Python, using concepts of variables,
conditionals, loops, and functions.

These are core concepts present in almost all


programming languages of the world.

Learning these can help you learn any other


language with ease.

In the coming classes of this module, we will


master these concepts to make interesting
projects.

Teacher shares the screen

Knowledge Last time I took you to this website to code in Teacher Activity 1
Transfer : python. This is an Online IDE for coding. :Repl.it platform
Open repl.it
Download and IDE stands for Integrated Development window and
Installation Environment. explain its
It’s simply a platform on which you can write structure.
codes and run them to get output.

Today we will:
1. Download Python.
2. Install Python on your computer.
3. Test Python with a simple program.

● Ask the student to share the screen


● Help the student to download Python using the instruction below

Ok so our first step is to ​ Download Python

Python is free and is to get from the Python.org


website
Click on Student Activity 1 Student Activity 1

So, this is the official website of python.

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
2
Help the student
Now, hover your mouse over the Downloads download the
menu button near the top and click the button correct version of
that begins with “Download Python 3”. python for the OS

It will take some time to download, till then let


me tell you more about Python.
Student Activity 2
Come back to the Toppr tab.
Click on the Student Activity 2. Ask the student if
they know what a
Can you tell me how many of these companies' company does,
names have you heard of?? engage in
conversation until
All these companies use Python for a lot of the download is
different tasks like developing their website, done.
solving a problem, creating a feature.

Python​ is among the top five most popular


languages in the world.
Let's check if the download is ready. Help the student
find the
Now, the next step is to I​ nstall Python, downloaded file.

Click on this exe file to install Python, it will take


some time for installation, we need to wait. **While
installation (select
Until then, tell me if you were wondering why ADD To Path
the language is named Python. option)**

So, let me clear the language is not named after


the snake python. If the student’s
system doesn’t
Actually Guido van Rossum, the programmer support
who wrote this language, loved watching a installation of
comedy show by group named “Monty Python, then
Python” continue with the
online IDE only
That inspired him to name the language
Python.

Let’s check if the installation is done.

Now, we will​ ​code to check if the Python is Help the student


working properly. find IDLE in the
start menu.

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
3
In your Start menu or Applications folder, find
the IDLE program and run it.

IDLE stands for Integrated Development and


Learning Environment.

See this text-based command window is called


the Python shell. A shell is a window or screen
that lets the user enter commands or lines of
code.

The >>> is called a prompt, and it means that


the computer is ready to accept your first
command.

The computer is asking you to tell it what to do.

Type ​print(“Hello Python”) Help the student


And press enter key. with Keyboard
controls.
Behold your first line of code in Python.
Great s​ tudent name!

Let’s save your code.


Help the student
Click on ​File​ button and then on S
​ ave to properly save
Name and save it. the file.

● Ask the student to stop sharing the screen.


● Open Repl.it(only console) and then share your screen

Teacher Now, let me show you something.


Activity
The code you just wrote used was the
print​ function.

It’s a very powerful function and it’s easy


too, right?

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
4
Just type ​print, ​put opening parenthesis
(​ and opening quotes ​“​ write whatever
you want to display, put closing quotes
then closing parenthesis and press enter
and voila, there you go.

But let me try something more,

Now, I will write the same thing but using


single quotes.

See the results are the same, so Python


understands whatever you give it in
either single or double quotes is to
display the same thing on screen.

In many other languages like Java and


C++, these quotes mean different things.

But what if we want to display quotes on


the screen too, Let’s try out.

We got an error because of the single in


between the sentence.

So, we used a backward slash before that


quote to tell python that this quote is not

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
5
the one python is looking for.

The backward slash is very helpful while


using the print function.

If we want to display something in two


lines we can use \n to do the same.

Using \t we can give space between


words in the same line.

These are actually called escape


characters.

Now, it’s your turn. Try these escape


sequence in your IDLE

● Stop your screen sharing


● Help the student to share their screen

Student Activity Open IDLE and try all the three escape Guide the student
characters we just learnt. to do the same.
Help with
keyboard controls
if needed.

Great!

Now, we will learn important mathematical


operators in python.

We can do addition, subtraction in python, as Ask student to try


we do it in maths using the plus and minus addition and
symbol. Can you find those keys on your subtraction on the
keyboard?? IDLE

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
6
Now, for multiplication we use the asterisk or Help the student
star symbol instead of the cross symbol we use locate asterisk on
in maths. keyboard and ask
Try finding that key on your keyboard. them to try
multiplication

For division too, we use a different symbol than Help the student
what we generally use. locate forward
We use a forward slash, can you find it? slash on their
keyboard.
Ok did you notice that you divide two integers
but got a decimal number as output. Make them do
simple division
Decimal numbers are called floating points in like 10/2,
programming languages. (numbers which
are exactly
divisible)
So to get integer output, we use double After explaining
forward slash, this is called floor division. The about //, ask them
result is rounded off. to try more
numbers.

There is one more important mathematical Help the student


operator that we have, i.e. Modulus operator or locate the symbol
the percent symbol %. and help them to
Can you locate it on the keyboard? use it.

This operator gives us the remainder of a


division.
For example if we divide 5 by 2, 1 is the
remainder, right?

Great, let's save our progress using File-> Save. Also mention the
shortcut CTRL+S

Ask the student to stop sharing the screen

Revision Wow, we did a lot of work today.


● Downloaded and installed Python,
● Used IDLE to code
● Saved our code
● Learned about Print statement
● Escape characters
● Mathematical operators

Quiz Can you answer some questions about what If the student is
we learned today?? not able to
answer, prompt

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
7
Q. Why is \n used? them with
A. To write in a new line. answers.
Q. Why is \t used?
A. To give a tab space.
Q. What does IDLE stand for?
A. Integrated Development and Learning
Environment.
Q. Who made Python?
A. Guido van Rossum
Q. Can you name two companies that used
Python?
A. Any two company name from the list
would work
Q. What does the % or modulus operator do?
A. It is used to find the remainder.
Q. What are floating point numbers?
A. Decimal numbers are called floating
point numbers.
Heads up tips for In the next class we will learn about variables,
next class (5 more on print function and operators also.
Mins)

BID GOOD BYE & END CLASS

Resources:

Activity Name Links

Teacher Activity 1 Repl.it platform https://repl.it/@TopprCodr/


ZanyMeanKeygens

Student Activity 1 Download Python https://www.python.org/

Student Activity 2 Companies which uses https://drive.google.com/fil


python e/d/1mOXecaVR5E_G_Y190
HG3f4_8o6D4ux9N/view?us
p=sharing

Copyright © 2020 by Toppr Technologies Pvt. Ltd.


All rights reserved. No part of this document may be distributed, or transmitted in any form or by any means, including photocopying,
recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
8

You might also like