M
maestro
why does this work? "while p" = "while p != 0" ? 1 is True and 0 is
false in python but other numbers have no boolean value so why doesnt
it abort.
print p
p -= 1
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
i can also do:
so obv while var means while not empty or why not zero but it isnt
something youd guess unless youd beeen shown it.
false in python but other numbers have no boolean value so why doesnt
it abort.
print p
p -= 1
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
i can also do:
k.pop()k=[]
while k:
k.pop()k=[1,2,3]
while k:
3
2
1
so obv while var means while not empty or why not zero but it isnt
something youd guess unless youd beeen shown it.