我创建了一本字典:new_list = {}这使, {'date': '13/09/2020', 'day': '13', 'month': '9', 'year': '2020', 'cases': '35', 'deaths': '0', 'countriesAndTerritories': 'Afghanistan', 'countryTerritoryId': 'AF', 'countryTerritoryCode': 'AFG', 'population2019': '38041757', 'continent': 'Asia', 'cumulativeper1000002Weeks': '1.3090878'} {'date': '12/9/20', 'day': '12', 'month': '9', 'year': '2020', 'cases': '34', 'deaths': '0', 'countriesAndTerritories': 'Afghanistan', 'countryTerritoryId': 'AF', 'countryTerritoryCode': 'AFG', 'population2019': '38041757', 'continent': 'Asia', 'cumulativeper1000002Weeks': '1.22496971'} {'date': '11/9/20', 'day': '11', 'month': '9', 'year': '2020', 'cases': '28', 'deaths': '0', 'countriesAndTerritories': 'Afghanistan', 'countryTerritoryId': 'AF', 'countryTerritoryCode': 'AFG', 'population2019': '38041757', 'continent': 'Asia', 'cumulativeper1000002Weeks': '1.16450983'}但现在我想将这本词典添加到列表中dataset= [new_list] 这使,[{'date': '13/09/2020', 'day': '13', 'month': '9', 'year': '2020', 'cases': '35', 'deaths': '0', 'countriesAndTerritories': 'Afghanistan', 'countryTerritoryId': 'AF', 'countryTerritoryCode': 'AFG', 'population2019': '38041757', 'continent': 'Asia', 'cumulativeper1000002Weeks': '1.3090878'}][{'date': '12/9/20', 'day': '12', 'month': '9', 'year': '2020', 'cases': '34', 'deaths': '0', 'countriesAndTerritories': 'Afghanistan', 'countryTerritoryId': 'AF', 'countryTerritoryCode': 'AFG', 'population2019': '38041757', 'continent': 'Asia', 'cumulativeper1000002Weeks': '1.22496971'}][{'date': '11/9/20', 'day': '11', 'month': '9', 'year': '2020', 'cases': '28', 'deaths': '0', 'countriesAndTerritories': 'Afghanistan', 'countryTerritoryId': 'AF', 'countryTerritoryCode': 'AFG', 'population2019': '38041757', 'continent': 'Asia', 'cumulativeper1000002Weeks': '1.16450983'}]然而我试图得到结果(所以只有“[]”在开始和结束),因为这样我就可以做 dataset[0:2](否则它会给我“Nonetype”对象不可下标)并且它只会给出前两个字典
查看完整描述