These implementations are for demonstration purposes. They are less efficient than the implementations in the Python standard library.
# Note: it's worth checking if the user has made a valid choice before the next line of code. # If the user typed somthing other than 0, 1 or 2 the next line will ...