Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 in ["a","e","i","o","u"]:
- print new_word
- else:
- print word[1:] + first + pyg
- else:
- print 'empty'
- """ Although it seems to print correctly in the output box I receive an error message keeping me from going further with the course. (I also posted this to the course forum)
- Oops, try again! Your word started with a consonant, but "dogay" was printed instead of "ogday". Make sure the correct value is stored in "new_word".
- In the output window I get ogday, the desired result.
- Is there anything apparent that would cause this?"""
- """mokomull> rfmonk: If I had to guess, the CodeAcademy thing doesn't actually look at what you printed, and instead looks at whatever's in the new_word variable. I would do `new_word = word[1:] + first + pyg` and `new_word = "empty"` (and replace `print new_word` with `pass`) inside the conditional, and just do "print new_word" all the way at the end, outside of the if statements.
- ok so when I declared my variables I changed
- new_word = word + pyg
- to
- new_word = word[1:] + first + pyg and new_word = "empty"
- print new_word changed to pass
- &
- print new_word outside the conditional at the end like:
- else:
- print new_word
- see paste pyg9of12.2.py"""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement