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
18 changes: 8 additions & 10 deletions piglatin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
def pigLatinEncryption(string):
'''
Objective : To encrypt a given word into Pig Latin word.
Input Parameters :
string : String entered by user to convert into Pig Latin form.
Objective : To encrypt a given word into Pig Latin word.
Input Parameters : string: String entered by user to convert into Pig Latin form.
Return Values : pigLatinWord
'''
#Approach : Use string methods and concatenation to convert the given word into Pig Latin form.
#Approach : Use string methods and concatenation to convert the given word into Pig Latin form.

ayString='ay'
tempCharacter=string[0]
Expand All @@ -14,24 +13,23 @@ def pigLatinEncryption(string):

def pigLatinDecryption(string):
'''
Objective : To decrypt a given Pig Latin form word into original word.
Input Parameters :
string : Pig Latin form string.
Objective : To decrypt a given Pig Latin form word into original word.
Input Parameters : string: Pig Latin form string.
Return Values : decryptedWord
'''
#Approach : Use string methods and concatenation to convert the given Pig Latin form into original word.
#Approach : Use string methods and concatenation to convert the given Pig Latin form into original word.

tempCharacter=string[-3]
decryptedWord=tempCharacter+string[:len(string)-3]
return decryptedWord

def main():
'''
Objective : To encrypt and decrypt a given word into Pig Latin word and vice versa respectively.
Objective : To encrypt and decrypt a given word into Pig Latin word and vice versa respectively.
Input Parameters : None.
Return Values : None.
'''
#Approach : Invoke pigLatinEncryption and pigLatinDecryption functions.
#Approach : Invoke pigLatinEncryption and pigLatinDecryption functions.


string=input("Input a word: ")
Expand Down