Code: Alles auswählen
In [822]: '10' > '2'
Out[822]: False
In [823]: 10 > 2
Out[823]: True
Code: Alles auswählen
In [822]: '10' > '2'
Out[822]: False
In [823]: 10 > 2
Out[823]: True
Code: Alles auswählen
In [3]: from collections import namedtuple
In [4]: Contributor = namedtuple("Contributor", "name email")
In [5]: contributor = Contributor("John Doe", "john.doe@example.net")
In [6]: contributor.name
Out[6]: 'John Doe'
In [7]: contributor.email
Out[7]: 'john.doe@example.net'
Code: Alles auswählen
class HighscoreEntry(object):
def __init__(self, n, s, d):
self.PlayerName=n
self.Score=int(s)
self.Date=d