Outer loop: for y in range(3) → y = 0, 1, 2
y = 0: [x for x in range(0)] → [] (empty list)
y = 1: [x for x in range(1)] → [0]
y = 2: [x for x in range(2)] → [0, 1]
data = [
[], # len = 0
[0], # len = 1
[0, 1] # len = 2
]
for d in data:
if len(d) < 2:
print('*')
d = [] → length 0 < 2 → prints *
d = [0] → length 1 < 2 → prints *
d = [0, 1] → length 2 < 2 → false, no print
C. two
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
4ba36e7
1 month, 3 weeks ago