forked from Krushna-Prasad-Sahoo/Sorting-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc.py
More file actions
29 lines (20 loc) · 592 Bytes
/
c.py
File metadata and controls
29 lines (20 loc) · 592 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def isVowel(c):
return (c == 'A' or c == 'E' or c == 'I' or
c == 'O' or c == 'U' or c == 'a' or
c == 'e' or c == 'i' or c == 'o' or
c == 'u');
def pigLatin(s):
length = len(s);
index = -1;
for i in range(length):
if (isVowel(s[i])):
index = i;
break;
if (index == -1):
return "-1";
return s[index:] + s[0:index] + "ay";
str = pigLatin("graphic");
if (str == "-1"):
print("No vowels found. Pig Latin not possible");
else:
print(str);