Computing
With Ms Hind
Inputting information and strings
The print function prints information to the screen. Type this in:
print (“Hello World”)
The input function allows the user to enter information into the computer. Type this in:
name = input("Hi. What's your name? ")
print ("Hello, ", name)
Variables
A variable is used in a program to store information. In the program above the variable is name. Because the variable is in quotes “” or ‘’, the variable type is called a string.
String
A string can contain letters, characters and numbers.
Challenge 1 - Write a program that….
Asks for the first name and then a surname.
Print the First name and then the second name
On the next line print the second name and then the first name
Extension: The name may not have a space between first and second names, can you work out how to add one?
Save as: Challenge 1 - Names