Kako riješi ovo ako itko zna?Ovo je samo dio zadatka ali nadam se da ce te se snaci u kodu.
You have to remove the first letter from the word, move it to the end, and then append the 'ay' suffix.
The most appropriate way to get the remainder of the string after removing the first letter is to use slicing. If you have a string s, you can get the "slice" of s from i to j using s[i:j]. This gives you the characters from position i to j.
For example, if s = "foo", then s[0:2] gives you "fo". Think about how to use this technique to get the rest of the string minus the first character.
Inside the else part of your if/else block that checks the first letter of the word, set the new_word variable equal to the translation result for a word that starts with a consonant.
Evo sat sam aj napravija:
pyg = 'ay'
original = raw_input('Enter a word:')
word=original.lower()
first=word[0]
if len(original) > 0 and original.isalpha():
print word
if first!="a" or "e" or "i" or "o" or "u" or "A" or"E" or "I" or "O" or "U":
print "consonant"
s= word
s[1:len(word)]
new_word=s+first+pyg
print new_word
else:
print "vowel"
new_word=word + pyg
print new_word
else:
print 'empty'
I daje mi rezultat riječ + suffix umisto da mi prvo slovos atvi an kraj ap onda doda sufix.