Input - Taking data from the user to the computer
Output - Sending data back to the user (such as sound, text, or changes to the screen)
Variable - A name that has a value that can change when the program is running (such as a score)
Algorithm - An order set of step-by-step instructions to solve a problem
Debug - Finding and fixing problems in your code
Look at the code for each question.
What do you think will be the output?
What is the actual output?
Look at the code on the right.
Run it and see what it does.
Click on the pencil icon at the top to see the code again.
Change "12" to another number.
What happens if you get rid of the Speech marks""? Does it still work?
Code
#Run the program, then change 12 to another number.
#What happens if you remove the " " from "12"?
myAge = "12"
myName = input("What is your name? ")
print("Wow! My name is " + myName + " too!")
print("I am " + myAge + " years old!")
Click on each link and try dragging and dropping code into the correct order
https://7strikelink7.github.io/NormalPythonParsons/parsons/Outputs.html
https://7strikelink7.github.io/NormalPythonParsons/parsons/Variables.html
https://7strikelink7.github.io/NormalPythonParsons/parsons/Inputs.html
Help:
print ( ) is used to output text
input( ) is used to get the user to type something
Variables store values that can change.
Name = Value here
e.g. myName = "John"
Make a program to output
"Good morning, user!"
Ask the user for their first name.
Then display "Hello" to the user with their name.
Hello [first name]
Make a program to create a variable called myAge. Display "I am also age years old!"
Enter your age: 12
I am also 12 years old!
What do you think will be the output to this code:
print ("Hello World")
What will be printed by the following code:
print(5 + 3)?
What will be printed by the following code:
print('Hello' + ' World')
What will be printed by the following code:
print(10 - 2)
What will be printed by the following code:
print(2 * 4)
What will be printed by the following code:
myName = "Amy"
print(myName)
What will be printed by the following code:
myAge = input("How old are you?")
Ask the user for their first name and their surname/last name. Display "Hello" with their full name
Hello [first name] [last name]
Ask the user for two numbers. Then add them both. Display the total.
Number 1: 5
Number 2: 3
Outputs: 8
CHALLENGE:
Ask the user for three numbers. Add the first two together and divide by the third number. Output the result
Number 1: 5
Number 2: 3
Number 3: 2
Number 1 + number 2 = 8
8 / Number 3 = 2
ASCII art is a type of art where an image is made from keyboard characters such
0
/|\
/\
Create a program to output ASCII Art.
(https://www.asciiart.eu/)