Python Itertools permutations only letters and numbers
问题 I need to get only the permutations that have letters and numbers (The permutation can not be. "A, B, C, D" I need it like this: "A, B, C, 1") In short, the permutations can not contain only letters, not just numbers. Must be a combination of both. My code: import itertools print list(itertools.combinations([0,1,2,3,4,'a','b','c','d'], 4)) Then I get: [(0, 1, 2, 3), (0, 1, 2, 4), (0, 1, 2, 'a'), (0, 1, 2, 'b'), (0, 1, 2, 'c'), (0, 1, 2, 'd'), (0, 1, 3, 4), (0, 1, 3, 'a'), (0, 1, 3, 'b'), (0,