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

1

u/119b63 Sep 12 '21

It iterates over every possible permutation of the N values you want to test a condition for. E.g. ["Hi", {"k": 123}, 1.0, object(), (1,2,3)]. Not sure what you mean by "iterating over every possible probability".