composition example 2

This commit is contained in:
Mert Gör 🇹🇷 2023-06-25 18:02:55 +03:00
parent fa416050e0
commit d846736b1b
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View File

@ -0,0 +1,10 @@
class Square:
pass
class Board:
def __init__(self):
self.squares = [[Square()] * 8 for i in range(8)]
board = Board()
print(board)