Read other people's code from time to time to pick things up.
Coming from C, learning Python, I did
text=""
for i in range(0,8)
text += ("\n" if i else "") + str(i)
return text
first instead of
return "\n".join([f"{x}" for x in range (0,8)])
now.
Being able to solve those things in one-liners frees up the mind to think about other things.
Try to just improve your code-fu, with you studies I suppose you have enough practical