Skip to content

Update recipe-576917.py#23

Merged
rawktron merged 1 commit into
ActiveState:masterfrom
kgashok:patch-3
Dec 12, 2017
Merged

Update recipe-576917.py#23
rawktron merged 1 commit into
ActiveState:masterfrom
kgashok:patch-3

Conversation

@kgashok

@kgashok kgashok commented Nov 15, 2017

Copy link
Copy Markdown
Contributor
  • included a lambda version (<2.7?) from the comments which does not work in 3.x
  • added a 3.x version as well

included a lambda version (<2.7?) and added a >3.5x version as well.
select_sort_l = (
lambda L: [] if not L else (
lambda idx, v: [v] + select_sort_l(L[:idx] + L[idx + 1:]))(
*min(enumerate(L), key=lambda t: t[1])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the * was the main fix for the syntax error that gets thrown in Python 3.

@rawktron rawktron merged commit dece889 into ActiveState:master Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants