Help with sorted

Hello there

Can anybody help me with this?

When I run this with Jupyter it returns an error though the syntax is right I think!!

Hey @osamahamdy1681161373 - welcome to the forums.

Is that all your code? If I run that in Python on my machine, it works fine. Admittedly, I’m running it directly in Python and not via Jupyter but I don’t see how that would affect what otherwise looks like a perfectly acceptable code snippet.


1 Like

Works for me.capture

Did you re-define sorted() somewhere earlier on the page? It seems to think that you are calling something with a value of None as a function in line 2.


Thanks all
I don’t know what caused the problem, but when I restarted Jupyter it worked just fine.