You could have found the solutions to your various puzzlements by reading in Alan's tutorial, < http://www.freenetpages.co.uk/hp/alan.gauld/>
The page reached by the "Simple Sequences" link probably is all you need.
Why don't you use these extremely useful sources of help?
Dick Moores
At 06:55 AM 3/25/2008, elis aeris wrote:
what if i want it only to 2nd decimal?
what if i want to cut off everything behind decimal?
On Tue, Mar 25, 2008 at 6:30 AM, Michael Connors <[EMAIL PROTECTED]> wrote:
- On 25/03/2008, elis aeris <[EMAIL PROTECTED]> wrote:
- x = 53
- w = 192
- for a in range ( x, (x+192) ):
- print (a-x)/w
- the problem is at (a-x)/w
- it's supposed to return a ratio between x and w, yet it 0 all the time.
- _______________________________________________
- Tutor maillist - Tutor@python.org
- http://mail.python.org/mailman/listinfo/tutor
- I think to do float division the operands should be floats.
- So if you do:
- print float(a-x) / float(w)
- It should produce a floating point result.
- --
- Michael Connors
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor