+ 1

Dominoes Set of 28

n = 0 for i in range(n,7): print( n, ":" ,i," "*5, 1, ":" ,i," "*5, 2, ":" ,i," "*5, 3, ":" ,i," "*5, 4, ":" ,i," "*5, 5, ":" ,i," "*5, 6, ":" ,i," "*5, ) i +=1 Output it gives is not what I want. 0 : 0 1 : 0 2 : 0 3 : 0 4 : 0 5 : 0 6 : 0 0 : 1 1 : 1 2 : 1 3 : 1 4 : 1 5 : 1 6 : 1 0 : 2 1 : 2 2 : 2 3 : 2 4 : 2 5 : 2 6 : 2 0 : 3 1 : 3 2 : 3 3 : 3 4 : 3 5 : 3 6 : 3 0 : 4 1 : 4 2 : 4 3 : 4 4 : 4 5 : 4 6 : 4 0 : 5 1 : 5 2 : 5 3 : 5 4 : 5 5 : 5 6 : 5 0 : 6 1 : 6 2 : 6 3 : 6 4 : 6 5 : 6 6 : 6 I want all numbers to start with theirselves until 6(6 included) I want 0:0 until 0:6 Then 1:1 until 1:6 2:2 --> 2:6 3:3 --> 3:6 4:4 --> 4:6 5:5 --> 5:6 and 6:6 Total of 28 couples... dominoes set Where is my mistake??

10th Jun 2021, 1:41 PM
Ceno Python
Ceno Python - avatar
5 ответов
+ 2
Ceno JUMP_LINK__&&__Python__&&__JUMP_LINK for n in range(0, 7): for i in range(n, 7): print(i, ":", n)
10th Jun 2021, 2:07 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Ceno JUMP_LINK__&&__Python__&&__JUMP_LINK Your welcome. If you need an explanation feel free to ask but I think it should be clear.
10th Jun 2021, 2:17 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Ceno JUMP_LINK__&&__Python__&&__JUMP_LINK But you've started. That's important. Maybe a list of tuples would be nice where each tuple represents your domino stone. Happy coding!
10th Jun 2021, 2:25 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
@Denise thank you
10th Jun 2021, 2:14 PM
Ceno Python
Ceno Python - avatar
+ 1
Denise Roßberg actually Im trying to create a dominoes game 🤣🙃 but as u can see, Im so far away... thank you for your support
10th Jun 2021, 2:19 PM
Ceno Python
Ceno Python - avatar