Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Chapter_1/pig_Latin_practice.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"""Turn a word into its Pig Latin equivalent."""
import sys

VOWELS = 'aeiouy'
VOWELS = "aeiouy"

while True:
word = input("Type a word and get its pig Latin translation: ")

if word[0] in VOWELS:
pig_Latin = word + 'way'
pig_Latin = word + "way"
else:
pig_Latin = word[1:] + word[0] + 'ay'
pig_Latin = word[1:] + word[0] + "ay"
print()
print("{}".format(pig_Latin), file=sys.stderr)

try_again = input("\n\nTry again? (Press Enter else n to stop)\n ")
if try_again.lower() == "n":
sys.exit()