定义类求长方体体积并格式化
类型:程序题

题目说明

class Box():
    def __init__(           ①           ):
                   ②           =length1
                   ③           =width1
                   ④           =height1
    def volume(self):
        return            ⑤
my_box=Box(10,20,30)
print("长方体体积是%.2f"%my_box.volume())

评分标准

(1)self,length1,width1,height1;(2分) (2)self.length;(2分) (3)self.width; (2分) (4)self.height;(2分) (5)self.lengthself.widthself.height。(2分)

代码编辑器 加载中...
留空使用题目默认限制
{{resultStatus.text}}
正在加载运行记录...
乐编题库AI助手
人工客服
微信扫码联系客服
历史对话
{{ s.title || '未命名对话' }}
{{ s.created_at }}
暂无历史对话
我能帮助你什么?