data-science-from-scratch
data-science-from-scratch copied to clipboard
error at line 219
File ".\Friends.py", line 219 key=lambda (user_id, num_friends): num_friends, # by number of friends ^ SyntaxError: invalid syntax
when changed to key = lambda user_id, num_friends: num_friends it says that only one of two parameters were given
I have same problem. I wrote 'lambda tp: tp[1]' then it works. Is it language version problem? Are there changes of syntax specification on sorted or lambda?