0

Pig Latin Code Coach Challenge

Why isn't it right? text = input() arr = list(text) arr2 = list(map(lambda word: word[1:]+word[0]+'ay', arr)) text = ' '.join(arr2) print(text)

27th Jun 2021, 10:23 AM
Yahel
Yahel - avatar
2 Antworten
0
because list(text) return array of char... instead try: arr = text.split() wich will return array of 'words' (default split separator is the 'space' char)
27th Jun 2021, 10:41 AM
visph
visph - avatar
0
visph oh, right.. forgot about that. Thanks :)
27th Jun 2021, 10:52 AM
Yahel
Yahel - avatar