Bite 2: Functions, global and local variables
In this Bite we are going to learn:
1. How to create functions
2. Understand global and local variables
3. Create the first bit of our game
Theory
Jupyter Lab notebook available here.
Practice
With what you just learned, can you create the program below using functions?
You will create two functions: “intro” will contain the introductory text and “username” will contain the part where we ask the user for their name.
You will then greet the user by their name outside both funcions.
The solution
Was this helpful?
Reader Interactions