Skip to content

Instantly share code, notes, and snippets.

@tugrul
Created March 7, 2022 19:14
Show Gist options
  • Select an option

  • Save tugrul/40c981b36b82b94833ca0b412ac8a78e to your computer and use it in GitHub Desktop.

Select an option

Save tugrul/40c981b36b82b94833ca0b412ac8a78e to your computer and use it in GitHub Desktop.
abn
find = lambda number, max: len([n for n in (a/b for a,b in (((a*b),(a+b)) for a in range(1,max) for b in range(1, max)) if a != 0 or b != 0) if n == number])
print(find(7, 1000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment