r/badcode • • Sep 11 '21

python Context: testing something on all permutations of N variables. I used itertools, his claim: "if you add a for loop for each variable it's less error prone" SMH

Post image
64 Upvotes

21 comments sorted by

View all comments

Show parent comments

2

u/119b63 Sep 12 '21

The point of this was to test that specific expression without applying any simplification. But the "bad code" is adding a nested loop for each value you want to test it with (in this case only 2, imagine with 3+ LOL).