code: def random_stats(self, all_stats, race, ch_class):
          stats = []
          res = {}
          for s in all_stats:
              stats.append(s['stat'])
              res[s['stat']] = 0
          cur_stat = 0
          for stat in stats:
              for ndx, i in enumerate(self.classes.dat):
                  if i['name'] == ch_class:
                      cur_stat = int(i[stat])
              for ndx, i in enumerate(self.races.dat):
                  if i['name'] == race:
                      cur_stat += int(i[stat])
              if cur_stat < 1:
                  cur_stat = 1
              elif cur_stat > 10:
                  if stat not in ('Health', 'max_health'):
                      cur_stat = 10
              res[stat] = cur_stat
          return res