Ad
Code
Diff
  • class Student:
        def __init__(self, first_name, last_name, grades=None):
            self.first_name = first_name
            self.last_name = last_name
            self.grades = [] if grades is None else grades
    
        @property
        def full_name(self):
            return f'{self.first_name} {self.last_name}'
    
        @property
        def email(self):
            return f'{self.first_name}{self.last_name[0]}@codewars.com'
    
        @property
        def grade_average(self):
            return sum(self.grades) / len(self.grades)
    
        def assess(self):
            if self.grade_average >= 90:
                return "A"
            if self.grade_average >= 80:
                return "B"
            if self.grade_average >= 70:
                return "C"
            if self.grade_average >= 65:
                return "D"
            return "F"
    • class Student:
    • def __init__(self, first_name, last_name, grades=None):
    • self.first_name = first_name
    • self.last_name = last_name
    • self.grades = [] if grades is None else grades
    • @property
    • def full_name(self):
    • return f'{self.first_name} {self.last_name}'
    • @property
    • def email(self):
    • return f'{self.first_name}{self.last_name[0]}@codewars.com'
    • @property
    • def grade_average(self):
    • if len(self.grades) <= 0:
    • return 'New Student'
    • else:
    • return sum(self.grades) / len(self.grades)
    • return sum(self.grades) / len(self.grades)
    • def assess(self):
    • if self.grade_average < 65:
    • return "F"
    • if 65 <= self.grade_average < 70:
    • return "D"
    • if 70 <= self.grade_average < 80:
    • return "C"
    • if 80 <= self.grade_average < 90:
    • return "B"
    • if self.grade_average >= 90:
    • return "A"
    • return "A"
    • if self.grade_average >= 80:
    • return "B"
    • if self.grade_average >= 70:
    • return "C"
    • if self.grade_average >= 65:
    • return "D"
    • return "F"
Code
Diff
  • package cat;
    public class kata{
      public static int doubleValue(int x) {
        return x * 2;
      }
    }
    • package cat;
    • public class kata{
    • public static int doubleValue(int x) {
    • return x = x*2;
    • return x * 2;
    • }
    • }