3 ms·
>Anything with fewer than three digits is supposed to be an invalid code So then why if your code is outputting "57" to the input "57" while the librarian's cl
by cmiller1 13y ago
>Anything with fewer than three digits is supposed to be an invalid code
So then why if your code is outputting "57" to the input "57" while the librarian's cleaner and more reasonable solution gives you "00057", why is yours more correct? Shouldn't the function work something like
if digits.size<3 raise 'Invalid zip code'
digits.rjust(5,'0')