Program is not executing in python
Question: I am using a book for learning python :

There is a file recommendations.py in which I have all this code

When I execute command on command line

    
    
    reload(recommendations)
    >>> recommendations.sim_distance(recommendations.critics,
    ... 'Lisa Rose','Gene Seymour')
    

It gives me following error

    
    
       Traceback (most recent call last):
        File "<pyshell#0>", line 1, in <module>
        reload(recommendations)
       NameError: name 'recommendations' is not defined
    


Answer: You just need to import `recommendations` before running your script.

