Where is it going?


#1


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

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word=original.lower()
first=word[0]
print original
else:
print 'empty'


Replace this line with your code.


#2

what do you mean with where is it going?


#3

A post was split to a new topic: Ending up


#4

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


#5

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


#6

9.move it on back

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


#7

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.


#8

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


#9

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