def is_valid_hostname(hostname):
 return (re.match('^[a-zA-Z0-9-]+$', hostname) is not None)

def is_valid_hostname ( hostname ) : return ( re . match ( '^[a-zA-Z0-9-]+$' , hostname ) is not None )
return true if the provided hostname is a valid hostname .