import json
import requests
response = requests.get(
    ' https://www.nbrb.by/api/exrates/rates/dynamics/145?startDate=2021-6-18&endDate=2021-6-25'
    )
data = json.loads(response.text)
print(data)


def average(data_):
    summa = 0
    days = 0
    for i in data_:
        summa += i['Cur_OfficialRate']
        days += 1
    return summa / days


print(average(data))

3c8d30cae53e45dd20d570fac23db51c1fa9d362
<mask token>


def average(data_):
    summa = 0
    days = 0
    for i in data_:
        summa += i['Cur_OfficialRate']
        days += 1
    return summa / days


<mask token>

<mask token>
print(data)


def average(data_):
    summa = 0
    days = 0
    for i in data_:
        summa += i['Cur_OfficialRate']
        days += 1
    return summa / days


print(average(data))

<mask token>
response = requests.get(
    ' https://www.nbrb.by/api/exrates/rates/dynamics/145?startDate=2021-6-18&endDate=2021-6-25'
    )
data = json.loads(response.text)
print(data)


def average(data_):
    summa = 0
    days = 0
    for i in data_:
        summa += i['Cur_OfficialRate']
        days += 1
    return summa / days


print(average(data))

import json
import requests
response = requests.get(
    ' https://www.nbrb.by/api/exrates/rates/dynamics/145?startDate=2021-6-18&endDate=2021-6-25'
    )
data = json.loads(response.text)
print(data)


def average(data_):
    summa = 0
    days = 0
    for i in data_:
        summa += i['Cur_OfficialRate']
        days += 1
    return summa / days


print(average(data))
