What's wrong with my code? Please help! Thanks


#1

pyg = 'ay'
original = raw_input('Enter a word')
word = original.lower()
first = word[0]
new_word = word + pyg
if len(original) > 0 and original.isalpha():
if first = 'a' or first = 'i' or first = '0' or frst = 'u' or first = 'e':
new_word = word[1:] + pyg
print new_word
else:
print "cconsonant"
else:
print 'empty'


#2

So in the previous lesson, "Move it on Back," the instructions said to:

Create a new variable called new_word and set it equal to the concatenation of word, first, and pyg.

That's missing here.

Next, in the current lesson you are in (you never mentioned which lesson you are on or provided a link), the instructions say the following:

Set new_word equal to the slice from the 1st index all the way to the end of new_word. Use [1:len(new_word)] to do this.

I didn't see this done. for your code.


#3

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