IDNLearn.com connects you with a global community of knowledgeable individuals. Our platform is designed to provide quick and accurate answers to any questions you may have.
num = 0
while num <= 0:
num = int(input("Enter a number: "))
i = 1
total = 0
while i <= num:
total += i
i += 1
print(total)
I wrote my code in python 3.8. Best of luck.