In this Python argument:
total = 0
for num in range(101):
total = total + num
print(total)
After I run the code in the Python IDLE shell (it runs correctly, returning a value of 5050) if I ask it to return the value of num
, it returns 100.
Why? I never assigned num
a value? Is the for
loop assigning it a value?