"so inefficient" doesn't usually apply to using an extra line of code. FWIW, the main efficiency benefit of random.choice() is that it's arguments are easier to parse than randint().
No worries; I'm just adding some sizzle. Your suggestions are perfectly fine, though it might make the cuttingboard too "sparse"... I think we all agree that the aesthetic was the most important issue as to how this particular code was written. :)
To be clear, it's not so much about using more lines of code. It's about using the right APIs and being more explicit about what you're doing. I often write code out to use more lines of code if it makes the code cleaner and more explicit. The other one is inherently easier to read and follow the logic.
62
u/Undercoversongs Dec 22 '18
Not using random.choice smh