Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created December 7, 2023 09:30
Show Gist options
  • Save stephengruppetta/9e8d0305d5416457726bcd1d26266fc2 to your computer and use it in GitHub Desktop.
Save stephengruppetta/9e8d0305d5416457726bcd1d26266fc2 to your computer and use it in GitHub Desktop.
import random
numbers = [random.randint(1, 50) for _ in range(20)]
print(numbers)
numbers.sort(key=lambda x: x % 5)
print(numbers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment