SEE IT                                                                      
                                                                                  
      Read      the   code     like   a  story                                    
                                                                                  
                                                                                  
                                                                                  
      Predict first. Then run it in the online editor.                            
                                                                                  
                                                                                  
                                                                                  
                                                                                  
        import random                                                             
        secret = random.randint(1, 5)                                             
        guess = int(input("Guess 1 to 5: "))                                      
        if guess == secret:                                                       
            print("You found the star!")                                          
        else:                                                                     
            print("It was", secret)                                               
                                                                                  
                                                                                  
                                                                                  
        ONE POSSIBLE OUTPUT                                                       
                                                                                  
        Guess 1 to 5: 3                                                           
        It was 5                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
        CODE DETECTIVE                                                            
                                                                                  
        Point to the part that can change. Point to the part that produces output. What do you think each
        punctuation mark is doing?                                                
                                                                                  
                                                                                  
                                                                                  
                                                                                  
      Randomness and Mini-Games                                           57
