Starter answer these questions in your book

Slides:



Advertisements
Similar presentations
Programming in python Lesson 2.
Advertisements

Main task -write me a program
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
By the end of this session you should be able to...
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
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.
1. Understand the application of Pseudo Code for programming purposes 2. Be able to write algorithms in Pseudo Code.
Advanced Work with Embedded and Summative Assessment Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education.
If the same piece of code needs to be used several times we can use a loop – but only if those times are all together. If you need to run the same bit.
Printing and Speaker Notes Presentation Authoring.
Coding Time This is a starter activity and should take about 10 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.Start a script session (Select.
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.
Starter – Its the small things in life What’s wrong with this code Height = 10 Width = 10 A = Height * Width Print A Remember to check: Spelling Spacing.
SMALL BASIC TO PYTHON CPD TRAINING CAS CPD. SCHEDULE 15:15 Refreshments 15: :45 Introduction 15: :45 Small Basic 16: :00 Python Workshop.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Input, Output and Variables GCSE Computer Science – Python.
Programming revision Revision tip: Focus on the things you find difficult first.
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.
Starter What does the following code do?
Chapter 1 Connections to Algebra Review
GCSE COMPUTER SCIENCE Practical Programming using Python
Writing algorithms Introduction to Python.
Multiplying Decimals.
A451 Theory – 7 Programming 7A, B - Algorithms.
Lesson 1 - Sequencing.
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
Week 4 Computer Programming Gray , Calibri 24
Unit 2 Smarter Programming.
Lesson 3 - Repetition.
Formatting Output.
Functions CIS 40 – Introduction to Programming in Python
Explain what touch develop is to your students:
Lesson 1 Learning Objectives
Learning to Program in Python
Learning to Program in Python
Learning to Program in Python
Fill the screen challenge!
Week 5 Computer Programming Gray , Calibri 24
Python Lessons 9 & 10 Mr. Kalmes.
Multiplying Decimals.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Programming In Lesson 3.
Learning Outcomes –Lesson 4
Learning to Program in Python
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.
Week 5 Computer Programming Year 9 – Unit 9.04
Python Lessons 13 & 14 Mr. Kalmes.
COMPUTER PROGRAMMING PYTHON
Computational Thinking for KS3
Week 4 Computer Programming Year 9 – Unit 9.04
How many objects can you create by drawing in the circles?
Flowcharts and Pseudo Code
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
B065: PROGRAMMING Variables 1.
Introduction to Python
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Python Inputs Mr. Husch.
Python Lessons 13 & 14 Mr. Husch.
Arrays & Loops.
Lecture 7 – Unit 1 – Chatbots Python – For loops + Robustness
Hardware is… Software is…
Starter Look at the hand-out.
Module 4 Loops and Repetition 9/19/2019 CSE 1321 Module 4.
Lecture 17 – Practice Exercise 3 SOLUTIONS
Challenge Guide Grade Code Type Slides
Presentation transcript:

Starter answer these questions in your book What is an integer? What is a float? What do we mean by input? What do we mean by output? What is a string?

Learning Intentions Lesson 6 Demonstrate use of variables to add score to a game Design a coding solution using Pseudocode Add responsive score feedback to the game

Homework - Pseudocode Hand in next lesson

Remember this from last lesson?

Maintaining score throughout game With just a few lines of extra code you should be able to maintain the score throughout the game and give some feedback at the end. Open your file saved from last lesson called maths_questions

Code to add the score

Score = score + 1 Think, pair share Do you understand what means?

Display the score at the end of the game What code would you have to type in to display the score at the end of the game?

Answer print (score) Even better if you did this: print (“Your score was “ +str (score)) Why do you need to type in str (score) ?

str (score) The score variable is an integer Python cannot add it to the end of a string. So the str() function converts it to a string for the purpose of this line of code. Python cannot add strings and integers together when printing

12_times_table Open the 12_times_table saved from last lesson. Add a scoring feature to each question. Add a line that prints out the score at the end. (Optional) How could you deduct a point if the answer is wrong? score = 0 #this defines variable score, and sets it as zero print("What is 1 x 12?") answer = input () answer = int(answer) if answer == 12: print("Well done") score = score + 1 #this increases score by one else: print("Sorry the answer was 12") print("What is 2 x 12?") if answer == 24: print("Sorry the answer was 24") print("Your score was " + str(score))

Use this slide to support pupils if required

Plan a solution using Pseudocode Think, pair, share Find out what is meant by Pseudocode - you have 5 mins Write your definition in your book

Pseudocode Pseudocode is a name given to a technique for designing and planning a coding solution that does not involve the actual code or programming language. The aim is enable someone to code a solution without using the correct syntax and therefore think more creatively.

Pseudocode it from lesson 2 What would the pseudocode be for this program? Work with a partner and write your solution down in your books.

Pseudocode it from lesson 2 It could look something like this: print “type in your name” input user name print “nice to meet you” + user name

Add responsive feedback to your game. You could simply report the score back at the end of the game. Even better if – you could give an appropriate feedback response based on how high or low their score was at the end of the game. Write the pseudocode first, then try writing it in Python.

Responsive feedback solution score = 0 if score > 2: print (“Well done!”) else print (“Oh dear”)

Responsive feedback solution Even better if: “Well done, you scored 3 out of 3 – very clever”, “Oh dear, you only scored 1 out of 3 – why not try again to improve”

Review –Lesson 4 Demonstrate use of variables to add score to a game Design a coding solution using Pseudocode Add responsive score feedback to the game