Re: (in Python) given a list of candidates [ (12, "Dat"), (5, "dat"), (4,"..."), ...] find the Tuple with the Min (1st) tag value

Liste des GroupesRevenir à cl misc 
Sujet : Re: (in Python) given a list of candidates [ (12, "Dat"), (5, "dat"), (4,"..."), ...] find the Tuple with the Min (1st) tag value
De : NoSpam_762 (at) *nospam* not_there.org (B. Pym)
Groupes : comp.lang.lisp comp.lang.misc sci.lang
Date : 10. Jul 2024, 17:26:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6mcog$1vuc4$1@dont-email.me>
References : 1
User-Agent : XanaNews/1.18.1.6
HenHanna wrote:

 
(in Python)  let's say i have a list of candidates
like this
           a= [ (12, "Data1"),  (5, "data"),  (4, "..."), ...]
 
and i want to find the Tuple with the Min (1st) tag value.
 
in Python that's what   min()   gives, by default.
 
                 min(a)
 
 
Is this the same in Scheme(Gauche) ?


(use gauche.collection) ;;  find-min

(find-min
  '[(12 "Data1") (5 "data") (4 "...")]
  :key car)

  ===>
(4 "...")
 


Date Sujet#  Auteur
10 Jul 24 * (in Python) given a list of candidates [ (12, "Dat"), (5, "dat"), (4, "..."), ...] find the Tuple with the Min (1st) tag value3HenHanna
10 Jul 24 `* Re: (in Python) given a list of candidates [ (12, "Dat"), (5, "dat"), (4,"..."), ...] find the Tuple with the Min (1st) tag value2B. Pym
11 Jul 24  `- Re: (in Python) given a list of candidates [ (12, "Dat"), (5, "dat"), (4,"..."), ...] find the Tuple with the Min (1st) tag value1HenHanna

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal