The code below already uses a subroutine to create an Easter Bunny name generator. The WHILE loop means that the bottom three lines will repeat infinately because True always = True. This means that the subroutine can be called over and over again with new values but without having to write any extra code.
Update this so that the user enters their name and the first & second letter of their name are used to calculate the bunny name using this pseudocode, then explain in your assignment why the ORD function and MOD operators have been used here:
name <-- int(input("Enter a number between 0 & 4"))
number1 <-- ORD(name) MOD 5
number2 <-- ORD(name) MOD 5
Sub-routines are really helpful for running calculations on similar pieces of data without needing to write the code more than once. The code below has started to write a program that takes in some data and calls four different sub-routines to manipulate the data in different ways.
hint: whilst you write each sub-routine, you may want to add a # in front of the incomplete def statements to allow the code to run.
Download Scribbl.it Notes
The Programming Parameters Scribbl.it Notes provide a structured way for you to revise topic areas in a visual way. You don’t have to be an artist as it’s all been drawn out for you (or you can use this as inspiration to create your own!). Print the notes, then colour in areas of importance, add doodles and colour, then add more detail to the notes page being as creative as possible.
There are known benefits to using Scribbl.it Notes (whether structured like these, or independently created):