python functions wft - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: python functions wft (/showthread.php?tid=85152) python functions wft by Jarrod on 08-02-2008 at 11:58 PM
i'm trying to write a python function which takes the string "s" and turns in a string or integer from an English representation, for example: code:now when i turn it into a function is should look like this code:but my return does not work can someone explain the technicalities of that to me? RE: python functions wft by segosa on 08-03-2008 at 01:37 AM
I don't know python at all but why is the function inside a while loop that'll continue forever? RE: python functions wft by Jarrod on 08-03-2008 at 01:53 AM
why not? quote:z = words2number(s) print z stop spamming you 2 RE: python functions wft by ShawnZ on 08-03-2008 at 10:01 AM
quote: because a loop that goes forever... doesn't end? RE: python functions wft by Mnjul on 08-03-2008 at 10:07 AM
There's a return inside the loop so the loop breaks. However that loop statement is indeed necessary.. you don't need the "while 1:", Jarrod RE: python functions wft by Jarrod on 08-03-2008 at 11:14 AM
i am missing an s the return does break the loop and tbh the loop isn't necessary but it's there to make sure, i did it without the loop in the end by as i said above z = words2numbers(s) RE: python functions wft by foaly on 08-03-2008 at 11:54 AM
quote:should break the loop....if it doesn't the program will probably crash... |