python code help!!?

function that adds up positive integers in order starting from 1 until the sum is greater than 100 and then displays how many integers we needed to add to get a sum greater than 100 doesn't quite work..


Here is my code:

def howmanyint():
sum = 0
i = 0
while sum <= 100:
sum = sum + i
i + 1
return i

Chris2016-02-08T15:28:39Z

Favorite Answer

Did you actually call this function? Because by itself, it's not going to do anything.

http://ideone.com/O17ypR