For -G7 programing language Teacher / Shamsa Hassan Alhassouni.

Slides:



Advertisements
Similar presentations
How SAS implements structured programming constructs
Advertisements

Μαθαίνοντας Python [Κ4] ‘Guess the Number’
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
A revision guide for programming with python. 1.A program is a set of instructions that tells a computer what to do. 2.The role of a programmer is to.
Control Structures FOR Statement Looping.
Python Control Flow statements There are three control flow statements in Python - if, for and while.
Java Programming Constructs 3 MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation.
Module 3 Fraser High School. Module 3 – Loops and Booleans import statements - random use the random.randint() function use while loop write conditional.
If statements while loop for loop
Python Mini-Course University of Oklahoma Department of Psychology Day 2 – Lesson 7 Conditionals and Loops 4/18/09 Python Mini-Course: Day 2 - Lesson 7.
CS 100 Introduction to Computing Seminar October 7, 2015.
Conditional Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 5 Repetition.
Iteration. Iteration: Review  If you wanted to display all the numbers from 1 to 1000, you wouldn’t want to do this, would you? Start display 1 display.
GCSE Computing: Programming GCSE Programming Remembering Python.
ITERATION. Iteration Computers are often used to automate repetitive tasks. Repeating identical or similar tasks without making errors is something that.
Nested For Loops. First, the rules to these loops do not change. We are sticking one loop inside another. while(condition) { // loop body } do { // loop.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Control Structures WHILE Statement Looping. S E Q C E N U E REPITITION …a step or sequence of steps that are repeated until some condition is satisfied.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
CS 106 Introduction to Computer Science I 02 / 15 / 2008 Instructor: Michael Eckmann.
More about Iteration Victor Norman CS104. Reading Quiz.
GCSE COMPUTER SCIENCE Practical Programming using Python
Trace Tables In today’s lesson we will look at:
Canvas and Arrays in Apps
A-level Computing Programming challenge 1: Fizzbuzz
EasyCode Foundations Vocabulary Terms.
Python Loops and Iteration
Week of 12/12/16 Test Review.
Lesson 4 - Challenges.
Lesson 05: Iterations Class Chat: Attendance: Participation
Warm-up Program Use the same method as your first fortune cookie project and write a program that reads in a string from the user and, at random, will.
Think What will be the output?
G7 programing language Teacher / Shamsa Hassan Alhassouni.
While Loops in Python.
Iterations Programming Condition Controlled Loops (WHILE Loop)
Writing Functions( ) (Part 5)
For Loops October 12, 2017.
Arrays, For loop While loop Do while loop
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Lesson 05: Iterations Topic: Introduction to Programming, Zybook Ch 4, P4E Ch 5. Slides on website.
Basketball Drill Programming Alternatives
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Looping and Random Numbers
Unit 3: Lesson 9-Looping and Random Numbers
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
G7 programing language Teacher / Shamsa Hassan Alhassouni.
IST256 : Applications Programming for Information Systems
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
More Looping Structures
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Console.WriteLine(“Good luck!”);
A LESSON IN LOOPING What is a loop?
Vocabulary Memory Cards--Sample
Starter....
PROGRAM FLOWCHART Iteration Statements.
Building Java Programs
More Looping Structures
Review of Previous Lesson
Topic: Iterative Statements – Part 2 -> for loop
CMPT 120 Lecture 10 – Unit 2 – Cryptography and Encryption –
Starter Look at the hand-out.
CMPT 120 Lecture 13 – Unit 2 – Cryptography and Encryption –
LOOP Basics.
Introduction to Python
Presentation transcript:

For -G7 programing language Teacher / Shamsa Hassan Alhassouni

What we will Learn today? Understand Random concept Understand for Loops Understand Nested Loops

Random

Random Function Description Input() Print () Built in Function not require any import. Randint() Should be imported / loaded in the program using command import

Guess the number

Types of Loops/ Iteration Loop Type Description while loop Repeats a statement or a group of statements while a given condition is TRUE. It tests the condition before executing the loop body. for loop Executes a sequence of statements with a defined number of times and abbreviates the code that manages the loop variable. nested loops You can use one or more loops inside any another loop

For Loop

For Loop Let’s say that you want to print hello five times. How you will do it using python print function The above was will take time and to make repeating process much easier we will use for loop Variable Name

For Loop-Time Table Activity

Nested Loop

Loop in Loop / Nested Loops

Loop in Loop / Nested Loops

Code challenge Rock, Paper Scissors

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