def squared(string, length):
row = 0
while row < length:
col = 0
while col < length:
l = string[(row + col) % len(string)]
print(l, end="")
col += 1
print("")
row += 1
#row = 0
#col = 0
#l = string[(0 + 0) % 2]
#Repeat for every col with col #+= 1 until it hits length
#Repeat with every row
if name == "main":
squared("abc", 5)
this is the code i wrote for that question but it doesn't work. I know you can do this by just making a really long string of the word repeated then just iterating over it using slicing to get the output, but just wondering if this can be done using the modulo operator instead, just for my own practice