joelgrus / data-science-from-scratch

code for Data Science From Scratch book
MIT License
8.63k stars 4.5k forks source link

error at line 219 #56

Open andreoliveirapguerra opened 6 years ago

andreoliveirapguerra commented 6 years ago

File ".\Friends.py", line 219 key=lambda (user_id, num_friends): num_friends, # by number of friends ^ SyntaxError: invalid syntax

andreoliveirapguerra commented 6 years ago

when changed to key = lambda user_id, num_friends: num_friends it says that only one of two parameters were given

devdmoji commented 4 years ago

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?