面朝大海,春暖华开

focus on scientific computue, 3dgis, spatial database
专注于科学计算、GIS空间分析

 

2020年5月22日

对于python中eval函数不能执行赋值操作的解决方法

摘要: 例如形如以下表达式会出错 eval('a =1') 1 解决方法,使用另一个强大的函数exec exec('a = 1') print(a) 1 2 输出1或者 b = 1 exec('c = b') print(c) 阅读全文

posted @ 2020-05-22 23:38 风过 无痕 阅读(742) 评论(0) 推荐(0) 编辑

小学数学手机打卡训练

摘要: 三则运算普通版 import math import random score=0 num=eval(input("questions:")) questions=[] errors=[] for i in range(num): a=random.randint(2,9) b=random.ran 阅读全文

posted @ 2020-05-22 21:59 风过 无痕 阅读(342) 评论(0) 推荐(0) 编辑

导航

向日葵支付宝收钱码