(text)
| 20 | |
| 21 | |
| 22 | def pig_latin_sentence(text): |
| 23 | words = text.split() |
| 24 | pig_latin_words = [] |
| 25 | |
| 26 | for word in words: |
| 27 | # Preserve capitalization |
| 28 | if word.isupper(): |
| 29 | pig_latin_words.append(pig_latin_word(word).upper()) |
| 30 | elif word.istitle(): |
| 31 | pig_latin_words.append(pig_latin_word(word).title()) |
| 32 | else: |
| 33 | pig_latin_words.append(pig_latin_word(word)) |
| 34 | |
| 35 | return " ".join(pig_latin_words) |
| 36 | |
| 37 | |
| 38 | user_input = input("Enter some English text: ") |
no test coverage detected