python数据分析基础(22)-计算表达式 2020-04-14 本文已影响0人 Zhigang_Han 将字符串str当成有效的表达式来求值并返回计算结果取出字符串中内容 s = "1 + 4 + 5 + 2" eval(s) out: 12