Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 Do Now Noticing skills What does input do?

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

3 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.

4 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)

5 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)

6 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

7 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

8 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().

9 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?

10 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?

11 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?

12 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

13 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


Download ppt "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."

Similar presentations


Ads by Google