This is my simple code:
Code:
import time
t1=time.clock()
g=raw_input("Wait a sec and press enter")
t2=time.clock()
print t2-t1
import time
t1=time.clock()
g=raw_input("Wait a sec and press enter")
t2=time.clock()
print t2-t1
if __name__ == '__main__':
try:
highscore2()
finally:
del highscore2
del columnize
oldscores = [(300, 'John', 1, 300, 12), (200, 'Jane', 200, 3, 4), (106, 'Bajs', 1, 106, 9), (102, 'Hej', 1, 102, 9), (83, 'test', 2, 41, 48), \
(68.700513199546208, 'Testny', 1, 68, 14.555932021867418), (66, 'Runk', 1, 66, 15), (58, 'test', 1, 58, 16), \
(53, 'Test4', 1, 53, 18)]
>>>
Total Score Name Times Played Median Value Total time played (sec)
Traceback (most recent call last):
File "D:\Python24\Test.py", line 25, in -toplevel-
highscore2()
File "D:\Python24\Test.py", line 22, in highscore2
print columnize(col_value, column_width),
File
hiscores = [(300, "John")]
score=raw_input("Score?")
player=raw_input("Name?")
hiscores.append((score, player))
print hiscores
hiscores.sort()
print hiscores
Leave a comment: