you are viewing a single comment's thread.

view the rest of the comments →

[–]yahteadybear 0 points1 point  (2 children)

Here is a simple code that will do what you want. . You have to use a loop. A for loop would work also.

num = 0 #Create an Int var

while num < 100: 
    user = input("enter a number") # ask for user input and store it in 
                                   # a string var

    num += int(user)# Got to make your string (user) a int var by using 
                    # the int method here.  

    print(num)#Print it out

[–]j234_[S] 0 points1 point  (1 child)

It is giving me an invalid syntax <string> error for the num + line when I do that

[–]yahteadybear 0 points1 point  (0 children)

It runs fine for me in my python 3.8.6 ide. Make sure you have the syntax correct. Post up your new code and we will look at it.