On 17/03/17 14:46, Aaliyah Ebrahim wrote:
> Hi, in my code below, why is it returning a value that is greater than 1200
> if my condition is that the value should be less than 1200?
Your condition is that it be less than 1200 when it enters the loop
body. That means it will *always* be 1200 or gre
Hi, in my code below, why is it returning a value that is greater than 1200
if my condition is that the value should be less than 1200? Thank you.
def sum_list(val):
list_sum = 0
n =0
mylist = []
while list_sum < val:
n = n+1
term = n**2
list_sum = list_sum