+ 1

Camel to Snake

Hey everyone.. I did the camel to snake task here on solo learn and my code comes up with 4 tests successful out of 5. Here's the code phrase = input() word = "" for x in phrase: if x.isupper(): word+= "_" + x.lower() else: word += x print(word) Any help is appreciated

3rd Jan 2025, 4:33 PM
Ikechukwu Ogbonna
2 Réponses
+ 4
your code did not solve the condition: If the capital letter begin the word, no need for a _ CamelCase = camel_case Your output _camel_case
3rd Jan 2025, 5:54 PM
Badgirl MIRI
Badgirl MIRI - avatar
0
Thank you
4th Jan 2025, 7:30 AM
Ikechukwu Ogbonna