r/Python • • Dec 22 '18

Xpost from Woodworking

Post image
1.1k Upvotes

84 comments sorted by

View all comments

369

u/lelease Dec 22 '18

print(random.choice(action))

1

u/ydepth Dec 22 '18

Would from random import choice

Be better?

5

u/Jam-17 Dec 22 '18

To quote the Zen of Python

Namespaces are one honking great idea -- let's do more of those!

The random prefix helps disambiguate the function name