All pastes #810764 Raw Edit

Someone

public python v1 · immutable
·published 2007-12-10 07:37 UTC
rendered paste body
#InstructionsWrite the definition of a class  WeatherForecast that provides the following behavior (methods): A method called  set_skies that has one parameter, a String.A method called  set_high that has one parameter, an int.A method called  set_low that has one parameter, an int.A method called  get_skies that has no parameters and that returns the value that was last used as an argument in  set_skies .A method called  get_high that has no parameters and that returns the value that was last used as an argument in  set_high .A method called  get_low that has no parameters and that returns the value that was last used as an argument in  set_low . No constructor need be defined. Be sure to define instance variables as needed by your "get"/"set" methods. #My Codeclass WeatherForecast (object): def __init__ (self,sky,high,low):    self.sky = sky    self.high = high    self.low  = low def set_skies (self, sky):    self.sky = sky def set_high (self, high):    self.high = high def set_low (self, low):    self.low = low def get_skies (self):    return self.sky def get_high(self):    return self.high def get_low(self):    return self.low