Can't solve the codes of the String problem

Hey , I wrote the following code for the code of the strings problem . It works properly for the sample case as well as for other test cases on the other compilers .However , my code is not passing any test case . Can someone please help ?

Here is the link to the code of my question .

Your output
aabe aay ale kbe ky

correct output
[aabe, aay, ale, kbe, ky]

Modiefied Code

@asaurabh_26 , was my answer wrong only because I didn’t put those ending and opening square brackets .Holy smokes .I thought there was some logical error.

yes this is because your output doesn’t match with expected output

no worry
keep learning and coding

if your doubt resolve plz mark it as resolved

Yes sure , thanks a lot

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

plz give your valuable feedback