我正在练习python,我想找到正确的运算符,以便在下面的等式等于120时找到 35(操作员)5(操作员)20(操作员)5(操作员)例如35 + 5 + 20 + 35 = 120
我已经在python中编写了这个脚本,但似乎没有产生。问题是,我不能使用除法(' /')。也可以包括括号。
Monad m => Vector Vector (m (Vector b))
答案 0 :(得分:0)
我改变了你的代码,所以它会打印测试字符串并在每个循环中得到结果,这就是我得到的:
35+5+20+5 evaluates to: 65
35+5+20-5 evaluates to: 55
35+5+20*5 evaluates to: 140
35+5-20+5 evaluates to: 25
35+5-20-5 evaluates to: 15
35+5-20*5 evaluates to: -60
35+5*20+5 evaluates to: 140
35+5*20-5 evaluates to: 130
35+5*20*5 evaluates to: 535
35-5+20+5 evaluates to: 55
35-5+20-5 evaluates to: 45
35-5+20*5 evaluates to: 130
35-5-20+5 evaluates to: 15
35-5-20-5 evaluates to: 5
35-5-20*5 evaluates to: -70
35-5*20+5 evaluates to: -60
35-5*20-5 evaluates to: -70
35-5*20*5 evaluates to: -465
35*5+20+5 evaluates to: 200
35*5+20-5 evaluates to: 190
35*5+20*5 evaluates to: 275
35*5-20+5 evaluates to: 160
35*5-20-5 evaluates to: 150
35*5-20*5 evaluates to: 75
35*5*20+5 evaluates to: 3505
35*5*20-5 evaluates to: 3495
35*5*20*5 evaluates to: 17500
如您所见,它永远不会评估为120。