A Text adventure Part 2
If you don't yet have a portrait image .
Below is the code we have completed so far check yours against the code below and fill in any gaps
In computer science, a function is a programming structure that can be used over and over again. We are going to look at a simple Function that prints a greeting.
Save your file as 'a simple function'
Wouldn't it be good if we could give some text to our function so it could used to print out a different greeting each time?
Don't forget to pass the 'username' to the function
One of the main reasons functions are used are to do some calculations then return the answer
Notice how we use the variable sum to store the value we get back from our function
Have a look at my code below.