Page 37 - Programming the Raspberry Pi Getting Started with Python
P. 37

Figure 3-6   The dice simulation
          If
          Now it’s time to spice up the dice program so that two dice are thrown, and if we get a total of 7 or 11,
          or any double, we will print a message after the throw. Type or load the following program into the
          IDLE Editor:



























             When you run this program, you should see something like this:



























             The first thing to notice about this program is that now two random numbers between 1 and 6 are
   32   33   34   35   36   37   38   39   40   41   42