+ 2
Why it is giving ouput as [] ? Where as range(0,11,1) is giving desired output?
rom itertools import product, permutations letters = ("A", "B") print(list(product(letters, range(0,11,-1))))
4 Réponses
+ 3
You have written -1 in range as step. Just clear it.
+ 3
Because the route from 0 to 10 is straight. You can write range (10, -1, -1)
+ 2
Why didn't it print those in reverse oder?
+ 2
Thank you 😊