题解 | #表达式求值# eval()
表达式求值
https://www.nowcoder.com/practice/9566499a2e1546c0a257e885dfdbf30d
# eval() 执行一个字符串表达式,并返回表达式的值。
while True:
try:
arithmetic=input()
print(eval(arithmetic))
except:
break
表达式求值
https://www.nowcoder.com/practice/9566499a2e1546c0a257e885dfdbf30d
# eval() 执行一个字符串表达式,并返回表达式的值。
while True:
try:
arithmetic=input()
print(eval(arithmetic))
except:
break
相关推荐
查看4道真题和解析