how can I make this into a while loop and output the same thing????
for x in range(56,120) :if (x < 57) :summation = 0summation = x + summationif (x == 119) :print (“Sum of integers from 56 to 120 is”, summation)
how can I make this into a while loop and output the same thing????
for x in range(56,120) :if (x < 57) :summation = 0summation = x + summationif (x == 119) :print (“Sum of integers from 56 to 120 is”, summation)
summation = 0
start_val = 56
stop_val = 120
while start_val < stop_val:summation += start_valstart_val += 1
print summation