兄弟们!这道题怎么写呀,我代码是正确的怎么也出错?代码是: from wonderLang import * def rect(x,y,w,h): jump(x,y) angle = -90 for i in range(2): forward(w) right(angle) forward(h) right(angle) def forecast(temps,space,base): x = 0 y = 0 w = 20 for i in range(len(temps)): temp = temps[i] rect(x,y,w,temp + base) x = x + w + space temps = [22, 19, 22, 21, 25, 27, 30] forecast(temps,20,4) 谁能帮我看看这里面哪里出错了?谢谢

2 条评论

  • @ 2023-1-6 8:32:21
    from wonderLang import *
    
    def rect(x,y,w,h):
        jump(x,y)
        for i in range(2):
            forward(w)
            right(-90)
            forward(h)
            right(-90)
    
    def forecast(temps,space,base):
        x=0
        y=0
        w=20
        for i in range(len(temps)):
            temp=temps[i]
            rect(x,y,w,temp*base)
            x=x+w+space
    
    temps=[22, 19, 22, 21, 25, 27, 30]
    
    forecast(temps,20,4)
    

    是p1210吧,@xiaoyingyu

    😄 2
    • from wonderLang import * def rect(x,y,w,h): jump(x,y) for i in range(2): forward(w) right(-90) forward(h) right(-90) def forecast(temps, space, base): x = 0 y = 0 w = 20 for i in range(len(temps)): temp = temps[i] rect(x, y, w, temp * base) x = x + w + space

      temps = [22, 19, 22, 21, 25, 27, 30] forecast(temps, 20, 4) 😄 应该是这个 错了告诉我

      🤔 2
      • 1

      信息

      ID
      128
      时间
      1000ms
      内存
      256MiB
      难度
      6
      标签
      递交数
      779
      已通过
      243
      上传者