temperature_tracker.py
def summary_from(self, temp_time_list):
        """
        Prints out a summary of the temperature readings in easy to read format.

        Includes average temperature, the number of readings, each reading in
        human-readable format, and the the maximum, minimum, and average temperatures.

        Parameters
        -------
        temp_list : [(float, time)]
            A list of (temperature, time) tuples that each specify a temperature
             readings and the time the reading was taken

        Returns
        -------
        string
            A string of summary details on the temperature readings
        """
        temp_dict = {}

        # first make sure all readings are up to date
        temp_dict['average'] = self.average()
        temp_dict['minimum'] = self.minimum()
        temp_dict['maximum'] = self.maximum()
        temp_dict['count'] = self.count()
        temp_dict['start_timestamp'] = self.start_timestamp
        temp_dict['stop_timestamp'] = self.start_timestamp

        if temp_dict['start_timestamp'] is None:
            return "The temperature tracker has not yet been started"
        else:
            summary_string = "The temperature tracker was started at: " + \
                             time.strftime('%Y-%m-%d %H:%M:%S',
                                           temp_dict['start_timestamp']) + "\n"
            summary_string += "A total of " + \
                str(temp_dict['count']) + " have been gathered\n"
            summary_string += "The readings so far are: \n"

            for i in range(0, len(temp_time_list)):
                summary_string += "\t\t" + "{:1.2f}C/{:1.2f}F at time {}\n".format(temp_time_list[i][0],
                                                                                   (((temp_time_list[i][0] * (9 / 5)) + 32)),
                                                                                   time.strftime('%Y-%m-%d %H:%M:%S', temp_time_list[i][1]))

            summary_string += "The average temperature was: {:1.2f}C/{:1.2f}F".format(
                temp_dict['average'], (((temp_dict['average'] * (9 / 5)) + 32))) + "\n"

            summary_string += "The maximum temperature was: {:1.2f}C/{:1.2f}F".format(
                temp_dict['maximum'], (((temp_dict['maximum'] * (9 / 5)) + 32))) + "\n"

            summary_string += "The minimum temperature was: {:1.2f}C/{:1.2f}F".format(
                temp_dict['minimum'], (((temp_dict['minimum'] * (9 / 5)) + 32))) + "\n"

            if temp_dict['stop_timestamp'] is not None:
                summary_string += "The temperature tracker was stopped at time: " + \
                                  time.strftime('%Y-%m-%d %H:%M:%S',temp_dict['stop_timestamp']) + "\n"

            else:
                summary_string += "The temperature tracker is still on.\n"


        return summary_string

        Prints out a summary of the temperature readings in easy to read format.

        Includes average temperature, the number of readings, each reading in
        human-readable format, and the the maximum, minimum, and average temperatures.

        Parameters
        -------
        temp_list : [(float, time)]
            A list of (temperature, time) tuples that each specify a temperature
             readings and the time the reading was taken

        Returns
        -------
        string
            A string of summary details on the temperature readings
        
Prints out a summary of the temperature readings in easy to read format.
Includes average temperature, the number of readings, each reading in
human-readable format, and the the maximum, minimum, and average temperatures.

Parameters

temp_list : [(float, time)]
A list of (temperature, time) tuples that each specify a temperature
readings and the time the reading was taken

Returns

string
A string of summary details on the temperature readings
Prints out a summary of the temperature readings in easy to read format . Includes average temperature the number of readings each reading in human - readable format and the the maximum minimum and average temperatures . Parameters temp_list : [ ( float time ) ] A list of ( temperature time ) tuples that each specify a temperature readings and the time the reading was taken Returns string A string of summary details on the temperature readings
def summary_from(self, temp_time_list):
        temp_dict = {}
        temp_dict['average'] = self.average()
        temp_dict['minimum'] = self.minimum()
        temp_dict['maximum'] = self.maximum()
        temp_dict['count'] = self.count()
        temp_dict['start_timestamp'] = self.start_timestamp
        temp_dict['stop_timestamp'] = self.start_timestamp
        if temp_dict['start_timestamp'] is None:
            return "The temperature tracker has not yet been started"
        else:
            summary_string = "The temperature tracker was started at: " + \
                             time.strftime('%Y-%m-%d %H:%M:%S',
                                           temp_dict['start_timestamp']) + "\n"
            summary_string += "A total of " + \
                str(temp_dict['count']) + " have been gathered\n"
            summary_string += "The readings so far are: \n"
            for i in range(0, len(temp_time_list)):
                summary_string += "\t\t" + "{:1.2f}C/{:1.2f}F at time {}\n".format(temp_time_list[i][0],
                                                                                   (((temp_time_list[i][0] * (9 / 5)) + 32)),
                                                                                   time.strftime('%Y-%m-%d %H:%M:%S', temp_time_list[i][1]))
            summary_string += "The average temperature was: {:1.2f}C/{:1.2f}F".format(
                temp_dict['average'], (((temp_dict['average'] * (9 / 5)) + 32))) + "\n"
            summary_string += "The maximum temperature was: {:1.2f}C/{:1.2f}F".format(
                temp_dict['maximum'], (((temp_dict['maximum'] * (9 / 5)) + 32))) + "\n"
            summary_string += "The minimum temperature was: {:1.2f}C/{:1.2f}F".format(
                temp_dict['minimum'], (((temp_dict['minimum'] * (9 / 5)) + 32))) + "\n"
            if temp_dict['stop_timestamp'] is not None:
                summary_string += "The temperature tracker was stopped at time: " + \
                                  time.strftime('%Y-%m-%d %H:%M:%S',temp_dict['stop_timestamp']) + "\n"
            else:
                summary_string += "The temperature tracker is still on.\n"
        return summary_string
def summary_from ( self , temp_time_list ) : temp_dict = { } temp_dict [ 'average' ] = self . average ( ) temp_dict [ 'minimum' ] = self . minimum ( ) temp_dict [ 'maximum' ] = self . maximum ( ) temp_dict [ 'count' ] = self . count ( ) temp_dict [ 'start_timestamp' ] = self . start_timestamp temp_dict [ 'stop_timestamp' ] = self . start_timestamp if temp_dict [ 'start_timestamp' ] is None : return "The temperature tracker has not yet been started" else : summary_string = "The temperature tracker was started at: " + time . strftime ( '%Y-%m-%d %H:%M:%S' , temp_dict [ 'start_timestamp' ] ) + "\n" summary_string += "A total of " + str ( temp_dict [ 'count' ] ) + " have been gathered\n" summary_string += "The readings so far are: \n" for i in range ( 0 , len ( temp_time_list ) ) : summary_string += "\t\t" + "{:1.2f}C/{:1.2f}F at time {}\n" . format ( temp_time_list [ i ] [ 0 ] , ( ( ( temp_time_list [ i ] [ 0 ] * ( 9 / 5 ) ) + 32 ) ) , time . strftime ( '%Y-%m-%d %H:%M:%S' , temp_time_list [ i ] [ 1 ] ) ) summary_string += "The average temperature was: {:1.2f}C/{:1.2f}F" . format ( temp_dict [ 'average' ] , ( ( ( temp_dict [ 'average' ] * ( 9 / 5 ) ) + 32 ) ) ) + "\n" summary_string += "The maximum temperature was: {:1.2f}C/{:1.2f}F" . format ( temp_dict [ 'maximum' ] , ( ( ( temp_dict [ 'maximum' ] * ( 9 / 5 ) ) + 32 ) ) ) + "\n" summary_string += "The minimum temperature was: {:1.2f}C/{:1.2f}F" . format ( temp_dict [ 'minimum' ] , ( ( ( temp_dict [ 'minimum' ] * ( 9 / 5 ) ) + 32 ) ) ) + "\n" if temp_dict [ 'stop_timestamp' ] is not None : summary_string += "The temperature tracker was stopped at time: " + time . strftime ( '%Y-%m-%d %H:%M:%S' , temp_dict [ 'stop_timestamp' ] ) + "\n" else : summary_string += "The temperature tracker is still on.\n" return summary_string
Prints out a summary of the temperature readings in easy to read format.
Prints out a summary of the temperature readings in easy to read format .
"""
        Prints out a summary of the temperature readings in easy to read format.

        Includes average temperature, the number of readings, each reading in
        human-readable format, and the the maximum, minimum, and average temperatures.

        Parameters
        -------
        temp_list : [(float, time)]
            A list of (temperature, time) tuples that each specify a temperature
             readings and the time the reading was taken

        Returns
        -------
        string
            A string of summary details on the temperature readings
        """ # first make sure all readings are up to date
self
temp_time_list