i = 0 num = 8 sum = 0 while i < num: sum = sum + i i = i + 1 print(sum)