Dec-13-2020, 09:30 PM
Can anyone help explain how to make this snippet follow a more functional style? I was able to functionalize other portions of the code but having trouble with this.
def Report (): data = Load () Report = "" LastDate = GetDate (data[0]) Count = 0; Counts = [0,0,0,0,0,0,0,0,0,0] for rec in data: Count += 1 ThisDate = RecToDate (rec) if ThisDate != LastDate: Report += Summary (Count,Counts) Count = 0; Counts = [0,0,0,0,0,0,0,0,0,0] LastDate = ThisDate for j in range (10): Counts[j] += RecRan (rec,j) Report += str (rec) return Report