1 because you are returning
new_list which is set to
1. The loop does not run.
It makes little sense to pass in an empty list, but if you wish to prevent the code from running then add in some validation. The most obvious would be to check if it is a list, but that hasn’t come up yet so we just have to assume it is one. We wrote the code so should know what to pass in.
if len(list_int) < 1: return "Input Error!"
result = 1
for i in list_int:
result *= i
new_list is a rather misleading variable name. It is a value, not a list. Use names that actually tell the reader what the variable represents so that you and your readers can make sense of it six months down the road.