Код: Выделить всё
def is_valid_zip(zip_code):
"""Returns whether the input string is a valid (5 digit) zip code
"""
return zip_code.isdigit() and len(zip_code) == 5
< /code>
i.e. Почему не ... < /p>
isdigit(zip_code) and zip_code.len()
Подробнее здесь: https://stackoverflow.com/questions/796 ... -syntax-vs