Q:

Python: Why is entry set to the value of 1

I am new to Python and I am trying to figure out why the value of entry in the following code is set to "1" at the top of the code, and why when I press "0" as the first and only digit when testing the code the "sum" gets to be "0" and not "1" when the "entry" is already bound up with number of “1”.
Also, what is entry called? A function?
Best regards
entry = 1
total = 0
while entry > 0:
    entry = int(input('Enter a number: '))
    total += entry
print('The sum of all numbers =', total)

A:

entry is a variable.
It has been set to 1 to enter into the while loop. For while loop to run you need condition to be True. So it evaluates 1 > 0 which is True and enters into the loop.
As value of entry is overriden in while loop, it takes the value from user input.
As you said if you press 0 the value of entry will become 0 instead of 1 and the will get added to sum which is 0 so 0+0 will return 0.
You can set it to any value greater than Zero.

