Skip to content
Merged
Show file tree
Hide file tree
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
Binary file added Images/practice5.py.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| 1 | [Code](practice1.py) | [Output](Images/1.png)
| 24 | [Code](practice24.py) | [Output Not Available]()
| 27 | [Code](practice27.py) | [Output](Images/27.png)
| 5 | [Code](practice5.py) | [Output](Images/practice5.py.jpg)
------------------------------------------------------
## Requirements:

Expand Down
15 changes: 15 additions & 0 deletions practice5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
''' Pig Latin problem
1) If the word begins with a vowel (a, e, i, o, or u), add “way” to the end of the
word. So “air” becomes “airway” and “eat” becomes “eatway.”
2) If the word begins with any other letter, then we take the first letter, put it on
the end of the word, and then add “ay.” Thus, “python” becomes “ythonpay”
and “computer” becomes “omputercay.” '''

def pig_latin(a):
if a[0] in 'aeiou':
return a+'way'
else:
return a[1:]+a[0]+'ay'

print(pig_latin(input("Enter any string p.s first letter should not be capital :")))