I need help with on of the function to calculate cycle Python.
Code:
> for Elem in ElemList:
print("Processing...") ElemTurn = int(Elem.get('turn')) ElemTime = int(Elem.get('time')) a = ElemTime print('Turn', ElemTurn) print('Time', ElemTime)
output:
Turn 1
Time 446500
Processing…
Turn 2
Time 446507
Processing…
Turn 3
Time 446510
Process finished with exit code 0
How for example can I calculate time from Turn 2 minus time from Turn 1, then time from Turn 3 minus time Turn 2, then time from Turn 4 minus time from Turn 3 etc and how to output it?