BUG HUNT                                                                    
                                                                                  
      Pip's    program         has    a  bug!                                     
                                                                                  
                                                                                  
                                                                                  
      Run the buggy version. Read the error message or strange output. Circle     
                                                                                  
      the smallest part you think should change.                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
        if energy >= 4 and "yes":                                                 
            print("Cloud-hopper")                                                 
                                                                                  
                                                                                  
      YOUR FIX                                                                    
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
        CHECK AFTER YOU TRY                                                       
                                                                                  
        if energy >= 4 and space == "yes":                                        
            print("Cloud-hopper")                                                 
                                                                                  
                                                                                  
                                                                                  
        Debugging pattern: observe -> guess -> change one thing -> run again.     
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
      AI and Smart Machines                                               89
