Python Lesson 2.

Slides:



Advertisements
Similar presentations
If Statement. IF Statements Executing code when one thing happens rather than something else is so common in programming that that the IF Statement has.
Advertisements

Developing and writing learning objectives
EasyGUI “Probably the Easiest GUI in the world”. Assumptions (Teachers’ Notes) This resources sets out an introduction to using easyGUI and Python
Making Decisions In Python
Computing Theory: BBC Basic Coding Year 11. Lesson Objective You will: Be able to define what BBC basic is Be able to annotate BBC basic code Be able.
Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)
PROGRAMMING In Lesson 5. RECAP  Complete the starter activity.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
From Scratch to Python Learn to program like the big boys / girls!
Year Seven The Seven Ages of Man Learning Objectives
An Introduction to Textual Programming
Hardware Lesson 5.
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
CATHERINE AND ANNIE Python: Part 4. Strings  Strings are interesting creatures. Although words are strings, anything contained within a set of quotes.
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
Python – Making Decisions Lecture 02. Control Structures A program that only has one flow is useful but limited. We can use if statements to make these.
The Seven Ages of Man Learning Objectives
By the end of this session you should be able to...
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
 starter activity Your teacher will give you a slip of paper with a question. Go up to a student and ask the question. Tell her the answer if she doesn’t.
PROGRAMMING In Lesson 2. STARTER ACTIVITY Complete the starter activity in your python folder – lesson 2 Now we will see how you got on and update your.
Python Programming Using Variables and input. Objectives We’re learning to use basic knowledge of variables combined with user input. Outcomes Continue.
Python Selection. All the programs you have been developing so far have been sequential, this means that each instruction is executed in a set order.
Python - Selection Selection means selecting (or choosing) what to do next. Should I cycle to school, or ask for a lift? If it’s a sunny day I might cycle.
ALAN….ALAN… ALAN. WHO IS ALAN TURING?
James Tam Making Decisions In Python In this section of notes you will learn how to have your programs choose between alternative courses of action.
Decisions in Python Boolean functions. A Boolean function This is a function which returns a bool result (True or False). The function can certainly work.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
3.1.3 Program Flow control Structured programming – SELECTION in greater detail.
GCSE Computing: Programming GCSE Programming Remembering Python.
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
Turtle Graphics Lesson 2 1. There are 3 homeworks to complete during the six lessons of this unit. Your teacher will let you know when a homework has.
PROGRAMMING In Lesson 6. RECAP  Discuss with the person next to you...  what you have enjoyed about python programming  What you have found difficult.
Programming In Python. Starter Using the internet… Find what a programming language is.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
“Be the Best” Learning Objective: Experiment to make the sounds effects for an animation. Sound Effects Story Lesson 1 1.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
PYTHON PROGRAMMING Year 9. Objective and Outcome Teaching Objective Today we will look at conditional statements in order to understand how programs can.
Starter What does the following code do?
Component 1 Logical operators.
Python 23 Mr. Husch.
Do it now activity Last lesson we used Flowol to create a solution to a problem a computer could solve. Identify what each symbol does:
LESSON 5 Learning Objective 1 Learning Objective 2 Did you know….?
Essentials of HTML.
Learning to Program in Python
Computer Networks Lesson 1.
Essentials of HTML.
Number Line Where are you on the learning journey?
Fill the screen challenge!
Programming In Lesson 3.
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
Selection (IF Statements)
Story time Task 5 Computer Programming Gray , Calibri 24
COMPUTER PROGRAMMING PYTHON
Pacman.
Learning Objectives Explain how selection is used to change a program output Decompose a problem with inputs to help design a program Describe the use.
Put it all together Lesson 5.
PYTHON: BUILDING BLOCKS Sequencing & Selection
Programming In Lesson 4.
PYTHON LESSON 5 Mr. Kalmes.
Computer Networks Lesson 1.
Computer Networks Lesson 5.
Hardware is… Software is…
Presentation transcript:

Python Lesson 2

Starter Start Python and create a program which will ask for the user’s name and current age and then will say Hello and will display their age on their next birthday. Possible Solution:

Objective of the lesson Write simple programs using Python. All of you will: Use If statements to make a decision. Most of you will: Use more complex If statements including “elif”. Some of you will: Create If statements within other If statements.

Homework Everybody should complete Tasks 1 and 2 to find the errors in the program and complete the crossword. Some of you may also want to get the extra marks by completing the extension activity. This homework is due in next lesson. Make sure you have written your homework clearly in your planner.

If Statements What will this code do? ## is used to create comments which are ignored by Python but make the code easier to understand. If Statements What will this code do? if is used to decide if an action is going to be followed. It ends with a : symbol. Indents are very important as this tells Python where the different sections start and end. else is used to describe what will happen if the first condition has not been met.

More If Statements if condition: elif condition: else: Statement if is used to decide if an action is going to be followed. elif stands for “else if” where you can test another condition. else is used to tell Python what to do if it hasn’t met any other conditions.

Try these out… Follow the instructions on the sheet to recap If statements. Remember to save them all with a suitable name followed by .py