Python Forum
Help! For pool to While pool - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Help! For pool to While pool (/thread-6683.html)



Help! For pool to While pool - nikecorei5 - Dec-03-2017

def function(n, step):
    s = 0
    for i in range(1, n, step):
        s += i
    return s
I need to translate to While pool. PLS help me! :)


RE: Help! For pool to While pool - buran - Dec-03-2017

http://www.pythonforbeginners.com/control-flow-2/python-for-and-while-loops

And it's loop, not pool :-)


RE: Help! For pool to While pool - stiletto009 - Dec-03-2017

hey did u solve it?can u share here?


RE: Help! For pool to While pool - gruntfutuk - Dec-06-2017

What's to solve? Looks fine to me. Returns the sum of the first n-1 integers.


RE: Help! For pool to While pool - buran - Dec-06-2017

(Dec-06-2017, 10:32 AM)gruntfutuk Wrote: What's to solve?

OP wants implementation using while loop
(Dec-03-2017, 10:23 AM)nikecorei5 Wrote: need to translate to While pool.