-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hakan
authored and
Hakan
committed
Jul 16, 2020
1 parent
aaaf0d7
commit ab58893
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# text = 'Pig latin is cool' # igPay atinlay siay oolcay | ||
# pig_it = 'Hello world !' # elloHay orldway ! | ||
|
||
# pig_l= pig_it.split() | ||
# new_pig_l = [] | ||
# for i in pig_l: | ||
# if len(i)!=1: | ||
# i = i[1:] + i[0] +"ay" | ||
# new_pig_l.append(i) | ||
# else: | ||
# new_pig_l.append(i) | ||
# pig_it = " ".join(new_pig_l) | ||
|
||
|
||
|
||
def pig_it(text): | ||
pig_l= text.split() | ||
return " ".join([i[1:]+i[0] + 'ay' if i!="?" and i!="!" else i for i in pig_l]) | ||
|
||
|
||
|
||
|
||
# def pig_it(text): | ||
# lst = text.split() | ||
# return ' '.join( [word[1:] + word[:1] + 'ay' if word.isalpha() else word for word in lst]) |