while_loop

sum : 1 to 10(or any number)\n total = 0 i = 1 while i <= 10: total += i i += 1 print(total)

--Sum of upto any numbers
n = int(input("Enter the numer: ")) total = 0 i = 1 while i <= n: total += i i += 1 print(total)