Do Now Noticing skills What does input do?. Annotate your code to explain what happens name = input( “What is your name?\n” ) print(“Hello ”, name) Extension-Python.

Slides:



Advertisements
Similar presentations
EasyGUI “Probably the Easiest GUI in the world”. Assumptions (Teachers’ Notes) This resources sets out an introduction to using easyGUI and Python
Advertisements

Programming in python Lesson 2.
16-May-15 Sudden Python Drinking from the Fire Hose.
Classes, methods, and conditional statements We’re past the basics. These are the roots.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Introduction to LabVIEW Seth Price Department of Chemical Engineering New Mexico Tech Rev. 10/5/14.
Yr 9 a computer science Nice to meet you variable challenge! 1.Variable assessment Looping in python 2.Looping assessment Drawing in python using turtle.
Python.
Computing Subject Knowledge Enhancement Python. SESSION OUTLINE Audit of your current position Practical Investigation GCSE Controlled Assessment Q&A.
An Introduction to Textual Programming
Python – Part 4 Conditionals and Recursion. Modulus Operator Yields the remainder when first operand is divided by the second. >>>remainder=7%3 >>>print.
The if statement and files. The if statement Do a code block only when something is True if test: print "The expression is true"
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.
ECS 10 10/8. Outline Announcements Homework 2 questions Boolean expressions If/else statements State variables and avoiding sys.exit(…) Example: Coin.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
Python Lesson Week 01. What we will accomplish today Install Python on your computer Using IDLE interactively to explore String Variables if/else while.
Bug Session Four. Session description Objectives Session activities summary Resources Prior knowledge of sequencing instructions using Bug Bug website.
Module 3 Fraser High School. Module 3 – Loops and Booleans import statements - random use the random.randint() function use while loop write conditional.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Python Repetition. We use repetition to prevent typing the same code out many times and to make our code more efficient. FOR is used when you know how.
Lesson 4 Using Variables in Python – Creating a Simple ChatBot Program.
1 C++ Programming Basics Chapter 1 Lecture CSIS 10A.
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 CSCI N201 Programming Concepts and Database 9 – Loops Lingma Acheson Department of Computer and Information Science, IUPUI.
Python Programming Using Variables and input. Objectives We’re learning to use basic knowledge of variables combined with user input. Outcomes Continue.
Python uses boolean variables to evaluate conditions. The boolean values True and False are returned when an expression is compared or evaluated.
22/11/ Selection If selection construct.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 17, 2015)
My Python Programmes NAME:.
ALAN….ALAN… ALAN. WHO IS ALAN TURING?
Python Let’s get started!.
Programming Seminar 2009 Night 0. Why we’re holding this seminar You’re probably not a computer science major – Or even anything remotely close (e.g.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
GCSE Computing: Programming GCSE Programming Remembering Python.
31/01/ Selection If selection construct.
Variables Continued In the last session we saw how variables are objects that allow us to store values in the RAM of the computer In this session we shall.
Introduction to Text Based Coding. We’re learning to explore how text based programming works You will display and enter text into a window You will use.
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.
GCSE Computing#BristolMet Session Objectives #23 MUST understand what is meant by the programming term iteration SHOULD describe methods of looping used.
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.
GCSE Computing: Programming GCSE Programming Remembering Python.
LO: We’re learning to outline a program using Pseudo Code.
Repetition In today’s lesson we will look at: why you would want to repeat things in a program different ways of repeating things creating loops in Just.
Python – Part 4 Conditionals and Recursion. Conditional execution If statement if x>0:# CONDITION print (‘x is positive’) Same structure as function definition.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
Getting Started With Python Brendan Routledge
Selection Using IF THEN ELSE CASE Introducing Loops.
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.
what is computer programming?
GCSE COMPUTER SCIENCE Practical Programming using Python
Python Let’s get started!.
Introduction to Python
Lesson 4 - Challenges.
Lesson 3 - Repetition.
To write a Python program, you first need to open Pyscripter
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Validations and Error Handling
Margaret Derrington KCL Easter 2014
Inputs and Variables Programming Guides.
Section 1 Introduction To Programming
A look at Python Programming Language 2018.
Python programming exercise
Programming In Lesson 4.
Input and Output Python3 Beginner #3.
Introduction to Python
Hardware is… Software is…
Presentation transcript:

Do Now Noticing skills What does input do?

Annotate your code to explain what happens name = input( “What is your name?\n” ) print(“Hello ”, name) Extension-Python colour code: purple green

Hinge question What happens: name=input( “What’s your name\n” ) print(“Hello”, Laura) A It asks the user for their name and then outputs Hello, Laura B It asks the user for their name and then outputs Hello C It asks the user for their name and then stops. D It asks the user for their name, and then outputs Hello, followed by their name.

Helpsheet name=input( “What’s your name\n” ) print(“Hello”, name) age = input( “How old are you?\n” ) print(“Wow, I am”, age, “too”) website = input(“What’s your favourite website? \n”) print(“Cool”, name, “Can you upload photo’s on”, website, “?”) Any text in black i.e variables can be changed Any text in green i.e text string outputs can be changed Do not change functions (purple)

Helpsheet name=input( “What’s your name\n” ) print(“Hello”, name) age = input( “How old are you?\n” ) print(“Wow, I am”, age, “too”) website = input(“What’s your favourite website? \n”) print(“Cool”, name, “Can you upload photo’s on”, website, “?”) Any text in black i.e variables can be changed Any text in green i.e text string outputs can be changed Do not change functions (purple)

First steps Open IDLE File-> New window Type in your code Go to Run-> Run Module (Or press F5) Keep persevering/show resilience! If you finish (Extension): gfscomputing.weebly.com

Main task Combine variable=input(“question”) and print (“text”, variable) to create a chat bot Extension: Could you use while or * to make your code more efficient or for artificial intelligence

Extension: Conditional if elif address=input(“Where do you live?”) if address == “Woolwich”: input(“Do you get the 161 to school?”) elif address == “Lewisham”: input(“Do you get the 89 to school?”) elif address == “Blackheath”: input(“Do you get the 89 to school?”) else: input(“Oh where’s that?”) Key point: If you are asking a question, you must use input(). If you are simply making a statement, you can use print().

Do I understand the code? Can I apply it? What do all the words mean? What tools do I need? Can I remember how the tools work? What is the problem asking me to do? Can I break it down into smaller sub-problems? Is my system efficient and effective? Does it meet the audience’s needs? Is it fit for purpose? How could it be improved? Have I created something new? How could my system be adapted for other uses? Eye Test 2 Is my code always efficient and effective? Is there an even more efficient (simpler) way?

True or false name=input( “What’s your name\n” ) print(“Nice to meet you”, name) age = input( “How old are you?\n” ) print(“Wow, my favorite colour is”, age, “too”) website = input(“What’s your favourite website? \n”) Print(“Cool”, name, “Can you upload photo’s on”, website, “?”) The user’s name is displayed as an output? There is a variable called colour? You can use the same variable name for different data? You have to declare every variable with = Variables can be output by using print(variableName) What is wrong with the last line of code?

True or false name=input( “What’s your name\n” ) print(“Nice to meet you”, name) age = input( “How old are you?\n” ) print(“Wow, my favorite colour is”, age, “too”) website = input(“What’s your favourite website? \n”) Print(“Cool”, name, “Can you upload photo’s on”, website, “?”) The user’s name is displayed as an output? There is a variable called colour? You can use the same variable name for different data? You have to declare every variable with = Variables can be output by using print(variableName) What is wrong with the last line of code?

Your name 1) What code have I learnt and used today? Why was it useful for this problem? 2) How was my coding efficient and effective? Is there an even more efficient (simpler) way? Or was there anything that I completely did not understand today

Task 1 Using print, produce a simple arithmetic formula e.g 108 multiplied by 91 equals… Task 2 Print your favourite line from a song 100 times using * Task 3 Print your favourite line from a song 100 times using a variable= and while Task 4 Using “while” produce a counter which counts up to 10 Task 5 Using “while” produce an output which counts down from 99 and prints “I’ve got 99 problems but my code isn’t one” Task 6 Go to gfscomputing.weebly.com and modify/hack my code to produce a new app