0
I got two codes to solve the pig latin challenge. Which one do you prefer? Why?
https://code.sololearn.com/c6pXIQ2Sek6Z/?ref=app https://code.sololearn.com/cYtLMqw2wkN5/?ref=app
5 Antworten
+ 2
Your first code.....do it as a one-liner.
+ 2
I follow the David's advice.
https://code.sololearn.com/c884t9iHLAcS/?ref=app
+ 1
I'd choose the second code, namely "pig_latin_challenge2.py". Not only is it shorter and more readable, but it's also more efficient.
You could improve it by using a list comprehension instead of the map() function. From my experience, list comprehensions are easier to understand.
+ 1
And also I writed in one line as rodwynnejones said!
0
I am not pretending to be praised. Just to share what I think is a progress in my python learning! I will apreciate if you share a perfect code to solve this chalenge! 😉