Introduction to Python Python is a programming language

  • Slides: 16
Download presentation
Introduction to Python

Introduction to Python

Python is a programming language. How confident are you that you could write multiple

Python is a programming language. How confident are you that you could write multiple computer programs in Python? 5 Extremel y Confiden t 1 Not Confiden t

Learning Outcomes LO 1 Be able to describe what Python is. LO 2 Create

Learning Outcomes LO 1 Be able to describe what Python is. LO 2 Create programs in Python. LO 3 Use a variable in a program.

Video goes here!

Video goes here!

Today we will learn to write programs in Python is a programming language. A

Today we will learn to write programs in 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.

Activity 1: Paired Syntax In a computer program what we type must be in

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.

print ( “ Hello World ” )

print ( “ Hello World ” )

Activity 2: Individual What do the different parts of the program actually mean?

Activity 2: Individual What do the different parts of the program actually mean?

This opens the statement. This indicates opening of the text that will appear on

This opens the statement. 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. print ( “ Hello World ” ) Indicates you want something to appear on the screen when you run the program. This is what will appear on the screen when you run the program. This closes the statement.

Your now ready to write your first program using Python!

Your now ready to write your first program using Python!

Lets get started -Open the Python program -You will now have the shell open

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. -We need to write and save When saving a program, you need to remember to put. py our programs in a new at the end of the file name. window. -Save your first program as hello. py Hint: to run a press F 5 to

Activity Create a program that will tell me: �You are learning to program in

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

What’s a Variable? Something that can change

What’s a Variable? Something that can change

This what we call the variable, it holds data while a program is running.

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? ”) print ( “Hello” +name )

Activity Writing programs that use the user input.

Activity Writing programs that use the user input.

Plenary How confident are you that you could write multiple computer programs in Python?

Plenary How confident are you that you could write multiple computer programs in Python? 5 Extremel y Confiden t 1 Not Confiden t