Pig Latin challenge | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Pig Latin challenge

I have recently attempted the pig Latin challenge however it only works for 3 out of 5 test cases(The 2 that donā€™t work are hidden so I donā€™t know what is wrong.) Here is my code: Please take a look, thanks!šŸ˜€ https://code.sololearn.com/c7nzQGwJ1npy/?ref=app Edit: I think it might be that if you only put one letter in, it breaks...

29th Jul 2020, 7:47 PM
HullaBrian
HullaBrian - avatar
5 Respostas
+ 2
By this statement : var = var.replace(firstchar,'') If input contains dublicate charecters, that is all equal to firstchar will get replaced by "". So just empty var[0]= "". And store back result..
29th Jul 2020, 8:00 PM
Jayakrishna šŸ‡®šŸ‡³
0
I think the issue may be your printing output in separate line... Try this print(var,end ="")
29th Jul 2020, 7:53 PM
Jayakrishna šŸ‡®šŸ‡³
0
Sorry, that didnā€™t seem to fix the problem.
29th Jul 2020, 7:55 PM
HullaBrian
HullaBrian - avatar
0
i also fixed the issue with one letter. That didnā€™t work either.šŸ¤”
29th Jul 2020, 8:00 PM
HullaBrian
HullaBrian - avatar
0
i did do it but the replace method also can be set to work only one time. So i got it to work! Thanks so much.šŸ‘
29th Jul 2020, 8:04 PM
HullaBrian
HullaBrian - avatar