fork(1) download
  1. def uniqueValues(aDict):
  2. '''
  3. aDict: a dictionary
  4. returns: a sorted list of keys that map to unique aDict values, empty list if none
  5. '''
  6. # Your code here
  7. ans = []
  8. if aDict.items()==None:
  9. return ans
  10. else:
  11. for key in aDict.keys():
  12. for i in range(len(aDict.keys())
  13. if aDict.values(i) != aDict.values(i+1):
  14. ans.append(key)
  15. ans.sort()
  16. return ans
  17.  
  18.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/py_compile.py", line 117, in compile
    raise py_exc
py_compile.PyCompileError:   File "prog.py", line 13
    if aDict.values(i) != aDict.values(i+1):
                                           ^
SyntaxError: invalid syntax

stdout
Standard output is empty