Learning Reflection Pig Latin Translator
Introduction Today, I decided to apply my Python knowledge to tackle the first project in Impractical Python Projects: building a Pig Latin translator. This challenge was a fun way to practice string manipulation, loops, and conditional logic. Below, I’ve shared my solution and compared it to the book’s solution, reflecting on the differences and lessons learned. My Solution Here’s the code I wrote for the Pig Latin translator: vowels = ["a", "e", "i", "o", "u"] while True: word = input( "Please type a word to translate to pig latin (or type 'q' to exit): \n" ).lower() if word == "q": print("Goodbye") break char_list = list(word) if char_list[0] in vowels: print(f"{word}yay") else: f_letter = char_list.pop(0) char_list.append(f_letter) print(f"{''.join(char_list)}ay") How It Works: ...