将CSV数据存储到变量Python中

我试图在python中从csv文件存储变量:

我有这个CSV

CountryName,  ChargeMinutes
Cape Verde ,    0.00
Algeria ,       10.80
St. Lucia ,     0.00
Cameroon ,      48.75
United States , 457,929.00

例如,我需要为每个国家/地区创建一个变量,并为其分配相同的名称,然后添加实际的收费分钟数;

cape_verde = 0
algeria = 10
st_lucia = 0
cameroon = 48 
etc...

我已经有了de csv的输出,但是我不知道如何将数据输出存储在变量:s中

import csv

with open("datatmx_headers.csv", "r") as f_input:
    csv_input = csv.DictReader(f_input)

    for row in csv_input:
        country = row['CountryName']
        minutes = row['ChargeMinutes']
        print(country, minutes)
评论