Demo entry 4135607

na

   

Submitted by anonymous on Mar 22, 2016 at 22:33
Language: Python 3. Code size: 628 Bytes.

tosort={}

f = open(class_number,"r")

while True:
    item = f.readline()
    if item == "":
        break
    for y in item:
        username, score1, score2, score3 = str.split(item,' - ')
        score3=score3.rstrip()

        if score1 == "*":
            score1 = str(score1)
        else:
            score1 = int(score1)

        if score2 == "*":
            score2 = str(score2)
        else:
            score2 = int(score2)

        if score3 == "*":
            score3 = str(score3)
        else:
            score3 = int(score3)

    tosort[username]=[score1, score2, score3]
f.close()

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).