MEASUREMENTS = ( 199, 200, 208, 210, 200, 207, 240, 269, 260, 263, ) def _calc_measurement(x: int, y: int): if x - y > 0: return f'{x}: increased' return f'{x}: decreased' def main(): it_a = iter(MEASUREMENTS) it_b = iter(MEASUREMENTS) print( f'{next(it_a)}: N/A - no previous measurement\n' + '\n'.join( map( _calc_measurement, it_a, it_b ) ) ) if __name__ == '__main__': main()