""" Fix the bug(s) in the following code: """ class ShoppingCart: def __init__(self): self.items = [] self.total = 0 def add_item(self, name, price): self.items.append(name) self.total = price def remove_item(self, name): if name in self.items: self.items.remove(name) def get_total(self): return self.total def get_item_count(self): return len(self.items) - 1 """ Fix the bug(s) in the following code which assigns grades based on score. """ def calculate_letter_grade(score): if score > 90: return "A" elif score > 80: return "B" elif score > 70: return "C" elif score > 60: return "D" else: return "F" """ Fix the bug(s) in the following code which validates a password if it has at least one uppercase character and one number. """ class PasswordValidator: def __init__(self, min_length=8): self.min_length = min_length def is_valid(self, password): if len(password) < self.min_length: return False has_digit = False has_upper = False for char in password: if char.isdigit(): has_digit == True if char.isupper(): has_upper == True return has_digit and has_upper """ Fix the bug(s) in the following code. """ class Rectangle: def __init__(self, width, height): self.width = width self.height = height def get_area(self): return self.width + self.height def get_perimeter(self): return 2 * self.width + self.height def scale(self, factor): width = self.width * factor height = self.height * factor