data-science-from-scratch icon indicating copy to clipboard operation
data-science-from-scratch copied to clipboard

error at line 219

Open andreoliveirapguerra opened this issue 7 years ago • 2 comments

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

andreoliveirapguerra avatar Sep 24 '18 18:09 andreoliveirapguerra

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

andreoliveirapguerra avatar Sep 24 '18 18:09 andreoliveirapguerra

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?

devdmoji avatar Oct 24 '19 02:10 devdmoji