In a predict and run task you do not write code from scratch. You start from a small piece of working code, work out what you think it will do before you run it, and then run it to check whether you were right.
This task contains one example.
Study the code below carefully and write down a prediction of what it will do
when it runs. Your prediction should use the key terms variable, assign
and concatenate. You can type your prediction straight into the code as a
comment, on a line starting with #.
Work out these things in particular:
Only once you have written your prediction should you run the code and compare the result with what you expected.
Need more help with input? Click here.
print("Hi! What's your name?")
name = input()
print("Hi " + name + "! How are you today?")
Run it, type a name and press enter. Then run it a second time with a completely different name and check that your prediction still holds. The program is the same both times; only the data it collects has changed.
Make sure that you check for the following things:
input command.= for assignment.+ symbol to concatenate (join).