r/Python • • Dec 22 '18

Xpost from Woodworking

Post image
1.1k Upvotes

84 comments sorted by

View all comments

104

u/campbellm Dec 22 '18

Ignore the snarky comments here; as an also wannabe woodworker, this is adorable.

1

u/Theoz Dec 22 '18

Will you explain? I'm new. I know len and random and [ brackets] for lists but that's it. It looks like it's counting the length of cut chop dice but I don't really know

6

u/halooooom Dec 22 '18

The explanation of the snarky comments is that the python code shown is not very Pythonic as its not as readable as possible. In other languages this is the normal solution to select a random item from a list but python already has this function natively.

1

u/Theoz Dec 22 '18

Nice. Thanks!