pyg = 'ay' original = raw_input('Enter a word:') if len(original) > 0 and original.isalpha(): print original word = original.lower() first = word new_word = word + first + pyg print new_word else: print 'empty'
There appears to be a missing step before the print statement. The part where you create a slice of
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.