Can't identify error..please help

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 + first + pyg
  print new_word
  print 'empty'


There appears to be a missing step before the print statement. The part where you create a slice of new_word.


It’s there new_word = word + first + pyg


I think they meant some other step than that.

First of all, why do you say that there’s a problem here? What is the difference in behaviour that you’re looking for?
The difference in what happens and what should have happened might already tell you exactly what you missed.
And then, when you’ve figured that out, you can start thinking about what area of your code is responsible, and start adding print statements there to see what’s happening step by step.


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