The absolute value
Alice and Bob went to the metrology station on the school tour. Due to the lockdown, the station was closed so, they decided to play some games. During that Alice pressed a button and left it unknowingly. After the opening of the station, the employee noticed that there are some inaccuracies. The chairman of the station defines inaccuracy as the absolute difference between the actual reading and forecasted reading.
As a employee, you have to calculate the inaccuracy across the week.
a denotes actual reading and f denotes forecasted reading.
You are asked to find. You can read the author’s code to see how to do it.
a = list(map(int, input().split())) f = list(map(int, input().split())) ans = 0 for i in range(7): ans += abs(a[i] - f[i]) print(ans)