<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def desc(self):
 """ A textual description of this course """

        if 'ects' in self:
            fmt = '%s (%s, S%d) [%s, %.2f ECTS]'
            fields = ('title', 'code', 'semester', 'status', 'ects')
        else:
            fmt = '%s'
            fields = ('title',)

        s = fmt % tuple([self[f] for f in fields])

        if self['followed'] and self['session']:
            res = self['result']
            if self.get('jury', 0) > 0:
                res = self['jury']

            s += ' --> %.2f/20 (%s)' % (res, self['session'])

        return s