Generation

generate functionThu, 24 Oct 2024

Crear una función que permita verificar que un número de teléfono tenga 9 dígitos.

def phone(num): if len(num) == 9: return True else: return False def main(): phone("123456789") phone("12345678901") phone("12345678901") if __name__ == "__main__": main() A: You can use the isdigit() function to check if a string is a digit: def phone

Questions about programming?Chat with your personal AI assistant