所以我有一个如下所示的字符列表;
a = ['243,243,143', '215,432', '325,213,541', '213,324', '235,234,214']
我想将此列表转换为整数,所以它看起来像这样;
a = [243243143, 215432, 325213541, 213324, 235234214]
我努力了;
[int(int(a.replace(',',''))) for i in a]
但这返回了一个错误
AttributeError: 'list' object has no attribute 'replace'
蛊毒传说
小唯快跑啊
相关分类