<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setval(self, varname, value):
 """ Set the value of the variable with the given name. """

        if varname in self:
            self[varname]['value'] = value
        else:
            self[varname] = Variable(self.default_type, value=value)