+ 3

Pig Latin problem

This code is approving 4 cases in Ping Latin challenge and is not approving one hidden case Code : https://code.sololearn.com/cK5S56gWeiCq/?ref=app Problem: pig Latin challenge

1st Apr 2022, 6:09 AM
Umar Farooq
5 Answers
+ 1
Could the logic be replacing all instances of the first letter, eg babe becomes aebay but it should be abebay {edit. yep, that's the problem. Is there another way to save&replace the first letter without replacing all of that letter in that word?}
1st Apr 2022, 7:13 AM
HungryTradie
HungryTradie - avatar
+ 3
G'day UMAR FAROOQ nice question! Tags, code, everything ✅ Have you tried debugging your code? What happens if you put in a 1 digit word, like "a" or "I"? {edit: nope, that seems ok....} {Edit 2: I just had a look at my C version, nothing special in the logic, I don't check for numerals or punctuation, mine passes so you don't need to add those checks. Sorry mate, might need some of the Python gurus to help you}
1st Apr 2022, 6:24 AM
HungryTradie
HungryTradie - avatar
+ 2
see your code slightly reworked. see also the comments: https://code.sololearn.com/cdU1pCixO280/?ref=app
1st Apr 2022, 10:44 AM
Lothar
Lothar - avatar
+ 2
Thanks guys I wasn't so good at debugging. Btw thanks for helping
1st Apr 2022, 8:21 PM
Umar Farooq
+ 1
UMAR FAROOQ I would look into list slicing.
1st Apr 2022, 9:20 AM
William Jönsson
William Jönsson - avatar