2 ms·
Why should it implicitly convert a number to a string? That's a common source of bugs. Explicit is definitely better. Why not just do the following? foo =
by throwaway37585 8y ago
Why should it implicitly convert a number to a string? That's a common source of bugs. Explicit is definitely better.
Why not just do the following?
foo = [1,2,3]
bar = {'1': 1, '2': 2, '3': 3}
for i in foo:
print(bar[str(i)])