I'm trying to make a short program where the user enters as many integers as they want. When they type 'done,' the program will calculate all of the numbers the user entered. So far when I run this program, all I get is "done." Am I close to being finished? Can someone help? Is the While loop good for this procedure?

user_inputs = []
        total = 0

        while 1:
            user_inputs = input("Enter integers. Type done to calculate the sum.")

            if user_inputs == "done":
                print("The sum of your numbers is " + user_inputs)
            else:
                user_inputs = int(user_inputs)

Errors:
You define user_inputs as a list, then redefine it as a string.
You might have not decided whether you collect all the inputs and then calculate the sum, or you want to calculate it on the fly..
Wrong intendation in the post.
You do not use the total variable.
You do not handle invalid numbers.
You have created an infinite loop.

Should be something like this (untested):

total = 0

while 1:
    user_input = input("Enter integers. Type done to calculate the sum.")

    if user_input == "done":
        print("The sum of your numbers is " + total)
    else:
        try:
            total += int(user_input)
            break
        except ValueError:
            print("invalid number: "+user_input)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.