def q2d():
count = 1
highestTemp = 0
lowestTemp = 999
fromTrolleyHighest = ""
fromTrolleyLowest = ""
sendOverData = []
graph = []
d = {}
data = p1.retrieveLiveDataSet()
print(f"values are..{data} ")
output = ""
for i in range(len(data)):
if i != len(data)-1:
if (data[i]['type'] == data[i+1]['type']):
output += str(data[i]['temperature'] + ',')
if (data[i]['type'] != data[i+1]['type']):
output += str(data[i]['temperature'])
d['type'] = data[i]['type']
d['temperature'] = output
sendOverData.insert(count, d)