I am a newbie to Python and I was trying my hand at the following problem: I want to add numbers entered by the user. Here is my program
add = 0 num = input('Enter a number:') add = add + num while num != ' ' : num = input('Next number:') add = add + num print add I want to terminate the program when a blank is entered. So I know the problem is with line 4. What would be the correct syntax?
Thanks in advance for your help