studdef
Март 31, 2016 19:14:54
Да конечно, надеюсь, что никто не будет думать что эта реклама)
https://www.codecademy.com/ раздел python
studdef
Март 31, 2016 19:26:05
Ну и для закрытия темы, не мог удержаться написать, что сказала мне обучалка)
Testing, Testing, is This Thing On?
Yay! You should have a fully functioning Pig Latin translator. Test your code thorougly to be sure everything is working smoothly.
You'll also want to take out any print statements you were using to help debug intermediate steps of your code. Now might be a good time to add some comments too! Making sure your code is clean, commented, and fully functional is just as important as writing it in the first place.
studdef
Март 31, 2016 20:10:41
сейчас перенес код на компьютер и получаю при вводе слова python —-> python
studdef
Март 31, 2016 21:05:09
Прошу прощения, за то что напостил так много) Но вот правильный код для решения задания:
pyg = 'ay'
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
print original
else:
print 'empty'
word = original.lower()
first = word[0]
new_word = word[1:] + first + pyg
print new_word
PS забыл дописать print new_word