All combinations of a mapped list of lists in python -


Hello how can I get a list of maps to print all possible combinations

It is said that the core mapping = {1: [A, B], 2: [C, D] ......

then with the list [1,2] and above all the sample mapping Product Mapping by importing itertools = {1: ['A', 'I' 'B'], 2: ['C', 'D']} data = [1, 2] for the combo in the product (* (mapping for data [D]): Print Results in

  ('a', 'c') ('a', 'd') ('b', 'c' ('B', 'D')   

Edit It looks like you actually want

Which wire == ['AC', 'Advertising', 'BC', 'BD'] .

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -