Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Python

Similar presentations


Presentation on theme: "Introduction to Python"— Presentation transcript:

1 Introduction to Python

2 Python is a programming language
Python is a programming language. How confident are you that you could write multiple computer programs in Python? 1 Not Confident 5 Extremely Confident

3 Learning Outcomes LO1 Be able to describe what Python is. LO2 Create programs in Python. LO3 Use a variable in a program.

4 Video goes here!

5 Today we will learn to write programs in Python
Python is a programming language. A programming language lets us type in instructions called programming code. The computer then runs these instructions. These instructions are what we call a computer program.

6 Activity 1: Paired Syntax In a computer program what we type must be in the correct order for the computer to understand or it will not work. Explain syntax and that they have the first program ever written by computer programmers in a card sort. Task to put it in the correct order.

7 print ( Hello World ) Explain what this line of code does.

8 Activity 2: Individual What do the different parts of the program actually mean? Definitions card sort

9 This indicates opening of the text that will appear on the screen.
This indicates the close of the text that will appear on the screen. This opens the statement. print ( Hello World ) This is what will appear on the screen when you run the program. Answers to card sort 2 This closes the statement. Indicates you want something to appear on the screen when you run the program.

10 Your now ready to write your first program using Python!

11 Lets get started -Open the Python program -You will now have the shell open this is where the program will run when we test it. When saving a program, you need to remember to put .py at the end of the file name. -We need to write and save our programs in a new window. -Save your first program as hello.py Hint: to run a press F5 to select run (the program must be saved first). Ask pupils to copy and try running the hello world program that they ordered.

12 Activity Create a program that will tell me:
You are learning to program in Python. What your name is. How old you are. What your favourite hobby is. What your favourite colour is. What your favourite subject is at school. What your favourite food is. Save as me.py Tell pupils why this is an important skill. We are learning how to create an output.

13 What’s a Variable? Something that can change Explain a variable.

14 name= raw_input (“What is your name?”) print ( “Hello” +name )
This what we call the variable, it holds data while a program is running. Means the user can input data and store it in the variable. name= raw_input (“What is your name?”) Talk about sensible variable names. print ( “Hello” +name )

15 Activity Writing programs that use the user input.

16 Plenary How confident are you that you could write multiple computer programs in Python? 1 Not Confident 5 Extremely Confident


Download ppt "Introduction to Python"

Similar presentations


Ads by Google