+ 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...
5 ответов
+ 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..
0
I think the issue may be your printing output in separate line...
Try this
print(var,end ="")
0
Sorry, that didn’t seem to fix the problem.
0
i also fixed the issue with one letter. That didn’t work either.🤔
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.👍