Download presentation
Presentation is loading. Please wait.
1
Empowering students with the skills required to lead the way in hi-tech world.
2
Section 1 Introduction To Programming
© LaunchPad Learning Inc. All rights reserved.
3
What is Computer Programming ?
Process of building and designing a set of instructions to tell computer what to do Code is everywhere, in every gadget: bots, drones, cars, toys, your phone…. Code = Apps = Software = Games !!!! © LaunchPad Learning Inc. All rights reserved.
4
© LaunchPad Learning Inc. All rights reserved.
Why learn how to code ? Coding is fun – Code your own apps and games! Coding is a valuable job skill – There is always a need for smart problem solvers like you Coding is a creative outlet – Create your own applications © LaunchPad Learning Inc. All rights reserved.
5
© LaunchPad Learning Inc. All rights reserved.
Why Python ? Python is a fun, simple to learn yet very powerful high level language Created by Guido van Rossum, named after Monty Python (a British band) Top 10 most used programming language; Used at Google, IBM, Amazon, and in colleges Tons of libraries/toolkits for gaming, networking, scientific and financial apps, AI and more! © LaunchPad Learning Inc. All rights reserved.
6
Section 1a Lets Get Started !!!
© LaunchPad Learning Inc. All rights reserved.
7
© LaunchPad Learning Inc. All rights reserved.
IDLE IDLE is Python’s Integrated Development and Learning Environment. Once python is installed on your computer, you will see a program with name “IDLE” added to your applications/program folder. IDLE can be used to interactively test some commands/single line statements in Python © LaunchPad Learning Inc. All rights reserved.
8
Section 1b Your First Program
© LaunchPad Learning Inc. All rights reserved.
9
Write and save your first Program
Open IDLE Open a new blank file: Go to File New File Write your piece of code in the file Save the file: Go to File Save Run the Program: Go to Run Run Module You will see your python code execute on IDLE’s python shell © LaunchPad Learning Inc. All rights reserved.
10
© LaunchPad Learning Inc. All rights reserved.
My First Program Open a new file Name the file MyFirstProgram.py and save it. Copy the following code Save the file and run it name = input("What is your name?\n") print("Hello,", name) Remember: Each color has a significant meaning © LaunchPad Learning Inc. All rights reserved.
11
© LaunchPad Learning Inc. All rights reserved.
Structure of a Program This is called a comment Comments are for users to understand the code. They are not executed by the computer. Remember # is used to start a comment # HelloName.py name = input("What is your name?\n") print("Hello, ", name) input and print are keywords in Python Every keyword has a specific meaning print tells python to print something on the screen input tells python to ask for user input name is a variable in python Variable stores information about data stored in computer memory © LaunchPad Learning Inc. All rights reserved.
12
© LaunchPad Learning Inc. All rights reserved.
Exercise 1 Task: 1 Download the file Exercise 1 from Weebly Open the file in IDLE. Run the file and see what it does. Task: 2 Notice, how commands input, print work Please complete the sections marked as TODO: Save the file and run it in IDLE Please do the code along with the students. © LaunchPad Learning Inc. All rights reserved.
13
Section 2 Variables and Strings
© LaunchPad Learning Inc. All rights reserved.
14
© LaunchPad Learning Inc. All rights reserved.
Variables Variables are something that you want computer to remember They are used by the computer program to store data They can store various types of data like numbers, strings, lists etc. Name of the variable: a Data stored in the variable: “Hello” © LaunchPad Learning Inc. All rights reserved.
15
Rules for Variable Names
A variable name must start with a letter or the underscore character A variable name cannot start with a number A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ) Variable names are case-sensitive (age, Age and AGE are three different variables) Keywords can not be used as variable names _12ada, Adada, A_234 are valid variable names 12asdada, are invalid © LaunchPad Learning Inc. All rights reserved.
16
© LaunchPad Learning Inc. All rights reserved.
Exercise Identify whether the names in the table below can represent valid variable name or not. Verify your results by trying to create variables with these names in Python shell. Name Valid/Invalid class 79ers CalgaryStampeders _unit Tip_in_dollars #LifeInParis © LaunchPad Learning Inc. All rights reserved.
17
© LaunchPad Learning Inc. All rights reserved.
String Built-in datatype in Python (class ‘str’) A sequence of characters (letters, numbers, symbols etc.) Enclosed within double quotation marks (” ") or single quotation marks (’ ’) Some examples of strings: 'hello', "hello" © LaunchPad Learning Inc. All rights reserved.
18
© LaunchPad Learning Inc. All rights reserved.
Exercise 2 Task: 1 Download the file Madlib from Weebly Open the file in IDLE. Run the file and see what it does. Task: 2 Download the file Exercise 2 Please complete the sections marked as TODO: Save the file and run it in IDLE You made a new Madlibs Game… Please do the code along with the students. © LaunchPad Learning Inc. All rights reserved.
19
© LaunchPad Learning Inc. All rights reserved.
That’s it for today Thank You !!!! © LaunchPad Learning Inc. All rights reserved.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.