In this example, I'm aware that Random is not a default keyword - it' s not included the code listing because this is the code example that actually works for me, albeit not completely because of the strange extra bracket that keeps appearing on the…