For -G7 programing language Teacher / Shamsa Hassan Alhassouni.

Slides:



Advertisements
Similar presentations
PROGRAMMING In. STARTER Using the internet…Find … what does case sensitive mean what a programming language is.. 3 benefits of Python.
Advertisements

Audacity Lesson One Venette Cook What will we do? 1.Open Audacity on the desktop. 2.Record your voice! 3.Save on your flash drive. Give a title. 4.Export.
Microsoft Excel 2003 Illustrated Complete with Excel Programming.
A First Program Using C#
Algorithms In general algorithms is a name given to a defined set of steps used to complete a task. For example to make a cup of tea you would fill the.
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.
Python Basic Syntax. Basic Syntax - First Program 1 All python files will have extension.py put the following source code in a test.py file. print "Hello,
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.
Computer Science 111 Fundamentals of Programming I Making Choices with if Statements.
Niranjan Paul Assistant Teacher Nikharhati Govt: Primary School. Nagarkanda, Faridpur.
Python Let’s get started!.
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.
A Level Computing#BristolMet Session Objectives#U2 S3 MUST use/read programme flow charts accurately SHOULD adapt the calculator programme to include a.
3.1.3 Program Flow control Structured programming – SELECTION in greater detail.
COMPUTER PROGRAMMING Year 9 – Unit 9.04 Week 3. Open the Python INTERPRETER Can you use the interpreter to solve these maths problems? 156 add
A stop sign is a traffic sign that stands for coming to a complete stop at an intersection or end of the road.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Introduction to Programming Python Lab 7: if Statement 19 February PythonLab7 lecture slides.ppt Ping Brennan
traffic lights red lightyellow lightgreen light.
JavaScript 101 Lesson 6: Introduction to Functions.
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.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
PYTHON PROGRAMMING Year 9. Objective and Outcome Teaching Objective Today we will look at conditional statements in order to understand how programs can.
3.1 Fundamentals of algorithms
Introduction to Python
Week 4 Computer Programming Gray , Calibri 24
Python Let’s get started!.
Introduction to Python
Making Choices with if Statements
Lesson 4 - Challenges.
Introduction to Python
Introduction to Programming
Variables, Expressions, and IO
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Microsoft Access Illustrated
Microsoft Office Illustrated
Starter Write a program that asks the user if it is raining today.
Learning to Program in Python
المحاضرة الثانية.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Week 3 Computer Programming Learning Objective:
Computer Science and an introduction to Pascal
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Introduction to Programming
Fill the screen challenge!
Today’s lesson – Python next steps
Use proper case (ie Caps for the beginnings of words)
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Week 2 Computer Programming Learning Objective:
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Story time Task 5 Computer Programming Gray , Calibri 24
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Hello World! Syntax.
Introduction to Programming
Program Flow Control Selection & repetition
Week 4 Computer Programming Year 9 – Unit 9.04
Superhero Quiz Year 9 Python.
Red lights, yellow lights, and green lights
Adding Intelligence Check for the presence or absence of a condition in the environment Take the appropriate actions Involves making a choice (to do or.
Additional Topics in VB.NET
Training & Development
Introduction In today’s lesson we will look at: why Python?
Introduction to Python
Introduction to Python
Introduction to Programming
CMPT 120 Lecture 4 – Unit 1 – Chatbots
Lecture 5 – Unit 1 – Chatbots Python – More on Conditional statements
Challenge Guide Grade Code Type Slides
Presentation transcript:

For -G7 programing language Teacher / Shamsa Hassan Alhassouni

Problem Solving Slow Down.. Pls Good Driver

What we will Learn today? Understand IF - else statements Use If – else syntax in python Use if – elif – else syntax in python Add comments Practical tasks

IF – ELSE Statement

IF .. else Statement Using If else statement to give two or more possible choices that a program can follow IF else Syntax

Discover more through your practical activity NO Task Completed Not Completed 1 Open the python edu 2 Select ‘the existing project named (grade7-1) 3 Click file > new > python file 4 Give the python file a name. (L7 - Name) 5 Type the following: 6 Run your program

Activity – color program Create a variable choice to get the user input If the user selected the character – a Print (“you are aggressive”) Else Print (“ you are social) if we have a word we assign “ “ for the word i.e if choice == “yes” If we have a single character we assign ‘ ‘ i.e if choice == ‘a’ If we have a number it should be written without any quotes. Important note

IF – elif – else Statement

Start IF .. elif Statement Input traffic Color If we have more than one condition we will be using a keyword for else if (elif) Is it Red Yes No Stop Is it Yellow If else Statement Yes No Wait Is it Green Yes No Go Stop

How many cases do I have in the traffic light case ?

Complete the activity Modify your car speed program If speed is more than 80 then the following message should appear “slow down.. Too fast” If speed is = 80 “good driver” If speed is lessthan 80 “you are so slow”

Activity – Modify color program You are aggressive You are social You are respectable You are lovely

Answer– Modify color program

comments

Comments are added in the program to explain what the program does. Syntax ## this program is called hello-world

How easy did find the today’s lesson in python?