Story time Task 5 Computer Programming Gray , Calibri 24

Slides:



Advertisements
Similar presentations
Session Objectives# 24 COULD code the solution for an algorithm
Advertisements

Python (yay!) November 16, Unit 7. Recap We can store values in variables using an assignment statement >>>x = We can get input from the user using.
Main task -write me a program
An Introduction to Textual Programming
ICAPRG301A Week 4Buggy Programming ICAPRG301A Apply introductory programming techniques Program Bugs US Navy Admiral Grace Hopper is often credited with.
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.
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.
What am I?. Translators Translators – Module Knowledge Areas Types of translators and their use Lexical analysis Syntax analysis Code generation and.
1 Program Planning and Design Important stages before actual program is written.
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
3.1.3 Program Flow control Structured programming – SELECTION in greater detail.
Python Lesson 2.
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.
GCSE COMPUTER SCIENCE Practical Programming using Python Lesson 4 - Selection.
PYTHON PROGRAMMING Year 9. Objective and Outcome Teaching Objective Today we will look at conditional statements in order to understand how programs can.
GCSE COMPUTER SCIENCE Practical Programming using Python
Introduction to Computing Science and Programming I
what is computer programming?
Topic: Python’s building blocks -> Variables, Values, and Types
3.1 Fundamentals of algorithms
Week 4 Computer Programming Gray , Calibri 24
Lesson 1 An Introduction
7 - Programming 7P, Q, R - Testing.
Debugging and Random Numbers
IF statements.
Year 10 IT: Programming Pathway Subject(s): VCE Computing
Introduction to Programmng in Python
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Algorithm and Ambiguity
Lesson Outcomes Be able to identify differentiate between types of error in programs Be able to interpret error messages and identify, locate.
Lesson 1 Learning Objectives
Ruth Anderson UW CSE 160 Winter 2017
Learning to Program in Python
Week 3 Computer Programming Learning Objective:
Computer Science and an introduction to Pascal
Learning to Program in Python
Selection CIS 40 – Introduction to Programming in Python
Learning to Program in Python
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Log onto a computer first then ….
Selection (IF Statements)
HAPPY NEW YEAR! Lesson 7: If-statements unplugged
Ruth Anderson UW CSE 140 Winter 2014
Loops CIS 40 – Introduction to Programming in Python
Computational Thinking for KS3
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
Coding Concepts (Standards and Testing)
Week 4 Computer Programming Year 9 – Unit 9.04
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Algorithm and Ambiguity
Flowcharting & Algorithms
Conditional Logic Presentation Name Course Name
Training & Development
Software Development Process
PYTHON: BUILDING BLOCKS Sequencing & Selection
Flowcharts and Pseudo Code
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
Game Over Module 4 Lesson 2.
Tonga Institute of Higher Education IT 141: Information Systems
Programming In Lesson 4.
Tonga Institute of Higher Education IT 141: Information Systems
Making decisions with code
Introduction to Python
Review of Previous Lesson
Starter Activities GCSE Python.
Variables, Constants, Assign.
Hardware is… Software is…
Year 8 Computer Science Digital Portfolio
Selamat Datang di “Programming Essentials in Python”
Presentation transcript:

Story time Task 5 Computer Programming Gray 80 69 69 69, Calibri 24 Dark Red RGB 153 0 0, Calibri 54 Story time

Why program? Click for an Idea!

Task Aims: T1 : Writing out text using 3x “ to write on multiple lines T2 : Using elif to extend conditional statement T3 : Understanding different error messages when debugging T4 : Importing the Time module T5 : Making your own function by defining with def T6 : Flowchart of your adventure so far T7 : Adding to the adventure T8 : Evaluating your progress

Story time What story can you tell? It should be creatively written Spelling, grammar & punctuation will be a strong part of this assessment!

T1 Adventure Game Setting the scene: Where will it take place? Task 1 Open Python and create a beginning for your Adventure: Where will it take place? When will it Happen? Who will be the hero What will be the Drama Will there be mild peril? Q:What does ””” do to the string?

Learning Objectives Identify... ...that if and else are limited to only two outcomes Describe... ..how elif can be used to extend options Explain... ...in your code how if , elif and else can work Apply... ...a range of conditional statements Link... ...your python code into a well written adventure

But what if you want more than one option? Last time, you entered in this program called MathsQuiz.py But what if you want more than one option?

…ELIF It allows you to extend your choices to more than just the two available with if else. Now you can have: if ...junk Food..."mmm keep it coming“ elif ...Doughnuts..."arggg drooool" elif...Sweets..."Its not doughnuts but mmmm" elif...Duff..."Mhmmmmm" elif (as many as you need - which for Homer is a lot!) else..."I can't eat this!!!"

T2 If…elif…else TASK 2: Copy out the code exactly as you see it, change the content to fit your story but watch out for these mistakes: Define the Choice variable at the start Use == and : on each if, elif and else statement Only 1 indentation for each of the print functions under a conditional statement

Code close up The variable we will use is called ‘choice’ define this first at the beginning Indentation shows “ownership” so the print function belong to the elif statement

T3 Debugging? There are 3 main errors made by programmers (that is us!) Syntax Errors – e.g.. silly typing errors Run-time Errors – e.g.. it may run but crashes at some point Logical Errors – e.g.. getting the code to run but it does something different This is probably the most common error you will get: a Trace back error message- its saying that the variable is not defined – did you assign choice=input properly? TASK 3: Run you program, If it comes up with an error message read it carefully – Is it telling you its a EOL ( end of line) Syntax error? Perhaps you forgot a colon at the end of a line of code?

Sign up at Codecademy and start this python course: http://www.codecademy.com/courses/python-beginner-sRXwR/0/1 This will be YOUR way of extending YOUR learning either in lesson or at home!

Hardware & Software Click >>>What is the difference between Software & Hardware? >>>Why do we have to program computers?

T4 Importing Time? TASKS: Keep the structure the same You have used the import feature of python with the Turtle work: it’s a library. A library or module always gets called at the start of your code TASKS: Keep the structure the same Change the information to your own story What does the time import do? What does the triple “”” do? Why is this useful? Why does work the way it does?

Making your own Functions TASK 5 Add this code to your Adventure Game:

Algorithms as Flowcharts

Flowchart of Adventure TASK 6: Create a flow chart planning out the structure and decisions in your adventure T7 Extend your Code TASK 7: Where will your Adventure go? Use the skills learned to extend your Adventure T8 Evaluate your Program TASK 8: Print screen your code, print screen it running & evaluate the program. For maximum marks use technical terms, discuss the problems you encountered, solutions as well as the what went well & how you could improve it .

1. Random function 2. Lists / Arrays 3. Functions Extension work