3, but the program stops with ValueError.
items = ["4", "x", "7", "", "10"]
count = 0
for s in items:
try:
n = int(s)
except TypeError:
continue
count += 1
print(count)
Which one change makes the program print 3?Log in to join the discussion.
Loading…