On 31 Jan 2007 19:13:14 -0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Its not an homework. I appeared for EA sports interview last month. I
> was asked this question and I got it wrong. I have already fidlled
> around with the answer but I don't know the correct reasoning behind
> it.

I think this works:

>>> def div7 (N):
...     return ((N * 9362) >> 16) + 1
...
>>> div7(7)
1
>>> div7(14)
2
>>> div7(700)
100
>>> div7(70000)
10000

The coolest part about that (whether it works or not) is that it's my
first Python program.  I wrote it in C first and had to figure out how
to convert it.  :)

Jesse
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to