0
Subset
Write a python script to print all possible subsets of r elements each from a given set of N elements. ::::::of r elements each:::::: Please anyone explain this part from the question.
7 odpowiedzi
+ 3
set with n = 5 elements:
[1, 2, 3, 4, 5]
all possible subsets with r elements each (r = 3):
[1, 2, 3]
[1, 2, 4]
[1, 2, 5]
[1, 3, 4]
(...)
+ 4
You can use the documentation to learn more about modules and how certain functions work etc., but it's not really meant to be a tutorial. It's probably better to search for "python 3 itertools tutorial" and find sites like this: https://data-flair.training/blogs/python-itertools-tutorial/
+ 3
Look into python's itertools module: https://docs.python.org/3/library/itertools.html#module-itertools (section "Combinatoric iterators")
+ 1
Thank you so much
But finding problems to create the program could you please create the program
0
Ok thanks