Where is it going?


pyg = 'ay'
new_word="word "+"first "+"pyg "

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
print original
print 'empty'

Replace this line with your code.


what do you mean with where is it going?


A post was split to a new topic: Ending up


wats wrong with my code plus i dont get instructions help???


which exercise are you at? What is the error message you get? What of the instruction do you not understand?


9.move it on back

console shows
Traceback (most recent call last):
File "python", line 2, in
NameError: name 'word' is not defined


why did you place:

new_word="word "+"first "+"pyg "

where you placed it?

Looking at the logic/flow of your program, defining new_word doesn't make much sense

Take a look at where you should define new_word

also, word, and first should be variable.


You seem to be making mistakes with variables. You ar constantly calling string literals instead of the variables:
new_word="word "+"first "+"pyg "
Should be:
new_word = word + first + pyg
Otherwise you would always get "word first pyg " as new_word instead of the actual values of the variables.
Also you should always make sure that all the variables that you call are defined already previously. new_word uses three variables: word, first and pyg. But at the moment you define new_word only pyg is defined already. word and first don't exist yet! You should move the second line way down to fix this.

Hope this helps


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