+ 2
Python possible ways
Hello guys.. I wanted to print all the possible position... For exaple max of y position is 15..and max of x.. Is 5...i want somthing like this to be printed [1,15] [2,14] [3,8] [5,9] Just all thw possible ways like this.. (those up were just exaples... I want it in order) I tried to use itertools.product...but i didint know how... I tried like this... But this will just swap the place in the possible ways itertools.product((range(1,6),range (1,16))repeat = 2)
3 ответов
+ 6
print([(i,j) for i in range(1,6) for j in range(1,16)])
+ 2
Thanks alot.. How couldn't i think of that.. 🤔🤔.. Thats a good way... Thanks again👍🏻👍🏻
0
no,python easy