Demo entry 2828929

prova

   

Submitted by anonymous on Oct 07, 2015 at 17:30
Language: Python 3. Code size: 606 Bytes.

def A_Ex6(file):
    fin=open(file,"r",encoding="UTF-8")
    semprealto=None
    nomi=fin.readline().strip().split(",")
    riga=fin.readline().strip().split(",")
             
    while len(riga[0])>0:
        for i in range(len(riga)):
            riga[i]=float(riga[i])
        for i in range(len(riga)):
            if riga[i]==max(riga):
                if semprealto==None:
                    semprealto=nomi[i]
                elif semprealto!=nomi[i]:
                    return None
                
        riga=fin.readline().strip().split(",")        
    return semprealto 

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).