Найти - Пользователи
Полная версия: PygLatin застрял
Начало » Python для новичков » PygLatin застрял
1 2
studdef
Да конечно, надеюсь, что никто не будет думать что эта реклама)
https://www.codecademy.com/ раздел python
studdef
Ну и для закрытия темы, не мог удержаться написать, что сказала мне обучалка)

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
сейчас перенес код на компьютер и получаю при вводе слова python —-> python
studdef
Прошу прощения, за то что напостил так много) Но вот правильный код для решения задания:

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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB