def name_to_tag(name):
 if (len(name) > 10):
  name = name[:10]
 return name.replace(' ', '_').strip()

def name_to_tag ( name ) : if ( len ( name ) > 10 ) : name = name [ : 10 ] return name . replace ( ' ' , '_' ) . strip ( )
returns sanitized str name: no more than 10 characters .