CloudCoder Python feladatgyujtemeny/enciklopedia

A MathWikiből
(Változatok közti eltérés)
Csirke (vitalap | szerkesztései)
(Új oldal, tartalma: „<python>def enciklopedia(szocikkek): elsok = {} for cikk in szocikkek: if cikk[0] in elsok: if cikk < elsok[cikk[0]]: elsok[…”)

A lap jelenlegi, 2015. november 16., 21:35-kori változata

def enciklopedia(szocikkek):
    elsok = {}
    for cikk in szocikkek:
        if cikk[0] in elsok:
            if cikk < elsok[cikk[0]]:
                elsok[cikk[0]] = cikk
        else:
            elsok[cikk[0]] = cikk
    return elsok
Személyes eszközök