Step 5 – Getting fancy with the name
It's all very well printing the name out, but it would be better if we could put it in a nice message.
This is a little bit trickier, so take care.
- Change your print(player) code to read: print("Hello brave " + player)
- Run your code to check what happens
The + symbol lets us link the "Hello brave" text with the variable. This is called concatenation
- Now change the code to try this: print("Hello brave " + player + ". Welcome to the Escape Room.")
- Run your program again to check it works
Watch the quotes ("), brackets and spaces carefully with this code.
You can use the + to concactenate like this with most variables, although it gets a little trickier when the variables are numbers.
Now do: What else could you add to your greeting for the player? Can you make the greeting match the theme of the escape room?