why not?
the return will act if a break if it works correctly anyway
quote:
Originally posted by Jarrod
code:
s = raw_input("what is the string")
def words2number(s):
while 1:
s = s.replace('one','1')
s = s.replace('two','2')
s = s.replace('three','3')
s = s.replace('four','4')
s = s.replace('five','5')
s = s.replace('six','6')
s = s.replace('seven','7')
s = s.replace('eight','8')
s = s.replace('nine','9')
s = s.replace('zero','0')
s = .replace(' ','')
s = s.strip()
s = s
return s
words2number(s)
z = words2number(s)
print z
stop spamming you 2