Skip to content

Instantly share code, notes, and snippets.

@jleeothon
Last active August 29, 2015 14:06
Show Gist options
  • Save jleeothon/c97caccfc2214c37cc5e to your computer and use it in GitHub Desktop.
Save jleeothon/c97caccfc2214c37cc5e to your computer and use it in GitHub Desktop.
This is a module I run when I want to do probability homework
import locale
from math import factorial as f
locale.setlocale(locale.LC_ALL, 'en')
nice = lambda: locale.format("%d", _, grouping=True)
@jleeothon
Copy link
Author

This magic only works in the console for the special variable _.
After doing whatever operations, type nice() and the last result will be printed in a nicer, more readable way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment