m0_62912552 2021-10-13 10:38 采纳率: 100%
浏览 16
已结题

如何修改python这个编码计算器里的错误

img

以下为错误
Test Failed: False is not true : get_expr call after step('+', 3) doesn't return a correct: should be '(0)+3'

Test Failed: False is not true : get_expr call after step('+', 3) and then repeat() doesn't return a correct: should be '((0)+3)+3'

Test Failed: False is not true : calling step() multiple times with different values and operations (like in the second writeup example) didn't produce the correct get_expr() results

Test Failed: False is not true : Second example (with both step and repeat calls) produces incorrect expressions

Test Failed: False is not true : Third example (with an initial clear, steps, and multiple repeats) produces an incorrect expression

Test Failed: False is not true : Another example not from the write-up didn't produce the correct expressions.

Test Failed: False is not true : Calling repeat immediately after calling clear(number), where number was a non-zero value, produced an incorrect output on either the value, expression, or both.

  • 写回答

1条回答 默认 最新

  • 於黾 2021-10-13 10:48
    关注

    错误信息告诉你很清楚了,当调用step,你应该返回'(0)+3'这个字符串,而不是int值
    回去仔细审题,再编代码,这代码写的乱糟糟的,integer都已经是全局静态变量了,你还一遍一遍return它干什么

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 10月21日
  • 已采纳回答 10月13日
  • 创建了问题 10月13日

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。