Hello how can I make a list of numbers that will increase by an x amount until the range is complete. Like I want set = [i for i in range(2,11)]
I want the contents of list
to be increase by 0.1, so its contents are going to go like [2, 2.1, 2.2, 2.3...... etc.]
.
Also how can I only print the contents of set1 of elements from the code below. instead of the outputs being (2, 1, 1) (2, 1, 2) (2, 2, 1) (2, 2, 2) (3, 1, 1) (3, 1, 2) (3, 2, 1) (3, 2, 2)
it would be(2) (2) (2) (2) (3) (3) (3) (3)
. Thanks for the help :)
import itertools
set1 = [i for i in range(2,4)]
set2 = [i for i in range(1,2)]
set3 = [i for i in range(1,2)]
list_set = [set1, set2, set3]
for element in itertools.product(*list_set):
print(element)