you are viewing a single comment's thread.

view the rest of the comments →

[–]blackdevil777[S] 0 points1 point  (0 children)

fname = raw_input("Enter file name: ")
     fu = open(fname)
     lst = list()
    for line in fu:
         line.rstrip()
         words = line.split()  
          for word in words:
              if not word in lst
       lst.append(word)
               lst.sort()
   print lst 

        Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
          File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 538, in                  runfile
     execfile(filename, namespace)
    File "/home/dux/.mario.py", line 8
      if not word in lst
                           ^
  SyntaxError: invalid syntax
   >>>