PygLatin - solved

python

#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

PygLatin

<In what way does your code behave incorrectly? Include ALL error messages.>
print(“please input a word to do the PigLatin!\n”)
pyg1= raw_input(“the word: \n”)
if (len(pyg1)>0 and pyg1.isalpha()!=0):
pyg2 = pyg1.lower()
pyg3 = pyg2[0]
pyg = pyg2[1:] + pyg3 + 'ay’
print pyg
else:
print(‘wrong word’)

<Below this line, add a link to the EXACT exercise that you are stuck at.>
File “python”, line 5
pyg3 = pyg2[0]
^
IndentationError: unindent does not match any outer indentation level

<What do you expect to happen instead?>

```python

Replace this line with your code.
PygLatin

<In what way does your code behave incorrectly? Include ALL error messages.>
print(“please input a word to do the PigLatin!\n”)
pyg1= raw_input(“the word: \n”)
if (len(pyg1)>0 and pyg1.isalpha()!=0):
pyg2 = pyg1.lower()
pyg3 = pyg2[0]
pyg = pyg2[1:] + pyg3 + 'ay’
print pyg
else:
print(‘wrong word’)

<do not remove the three backticks above>

#2

I have solved this problem, thanks!


#3

pyg = 'ay’
original = raw_input(‘Enter a word:’)
if len(original) > 0 and original.isalpha():
print original
word = original.lower()
first = word[0]
new_word = word[1:len(word)] + first + pyg
print(“the PygLatin word is:”), new_word
else:
print ‘empty’


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.