CubeSimple interview question

To write the python code for the random numbers and python pattern program