So what is the program supposed to do? Are you supposed to input a number and get the word form of the number? Or input the word and get the integer it represents?
And incase you didn't know the code tags they are [COD'E] [/COD'E] with out the ' in them.

So what is the program supposed to do? Are you supposed to input a number and get the word form of the number? Or input the word and get the integer it represents?
And incase you didn't know the code tags they are [COD'E] [/COD'E] with out the ' in them.

this is code......

I think he means that you have to pass a word and convert it in an integer.

But like your code, if I don't search for a word that is in the list, it gives ne an index error. That's not converting anything, just spitting out the same word. I was thinking like the integer 10 to "ten"

But like your code, if I don't search for a word that is in the list, it gives ne an index error. That's not converting anything, just spitting out the same word. I was thinking like the integer 10 to "ten"

Okay if U give a number in words larger then nine it will throw an error,
but I just used the same example as the topic starter.

the thing you ask is the reverse, if U want that you have to do:

def numtoword(num):
wordlist=["zero","one","two","three","four","five","six","seven","eight","nine"]
if int(num)>len(wordlist):
print "sorry that number is not in the list"
else:
return wordlist[int(num)]