class Stock:
    def __init__(self, symbol):
        self.symbol = symbol
        self.price = None

    def update(self, timestamp, price):
        self.price = price

class Stock:
    def __init__(self, symbol):
        self.symbol = symbol
        self.price = None

    def update(self, timestamp, price):
        if price < 0:
            raise ValueError("price should not be negative")
        self.price = price

Update update method for negative price exception.
Update update method for negative price exception.

  class Stock:
      def __init__(self, symbol):
          self.symbol = symbol
          self.price = None
  
      def update(self, timestamp, price):
+         if price < 0:
+             raise ValueError("price should not be negative")
          self.price = price
  
Update update method for negative price exception.
## Code Before:
class Stock:
    def __init__(self, symbol):
        self.symbol = symbol
        self.price = None

    def update(self, timestamp, price):
        self.price = price

## Instruction:
Update update method for negative price exception.
## Code After:
class Stock:
    def __init__(self, symbol):
        self.symbol = symbol
        self.price = None

    def update(self, timestamp, price):
        if price < 0:
            raise ValueError("price should not be negative")
        self.price = price
