重载__add__ [英] overload __add__

查看:45
本文介绍了重载__add__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我正在构建这个带有粒子并显示连锁反应的反应堆软件(一项任务)。


这是我到目前为止的代码:

展开 | 选择 | Wrap | 行号

解决方案

你的论点不匹配:

展开 | 选择 | Wrap | 行号


我收到一条错误消息。这就是我所做的(我已经想出了self.lhs = lhs,我得到它打印......但不对)。

展开 | 选择 | Wrap | 行号



我收到一条错误消息。这就是我所做的(我已经想出了self.lhs = lhs,我得到它打印......但不对)。

展开 | 选择 | Wrap | 行号

OK, I''m building this reactor software (an assignment) that takes particles and shows a chain reaction.

Here is the code I have so far:

Expand|Select|Wrap|Line Numbers

解决方案

You are mismatching your arguments:

Expand|Select|Wrap|Line Numbers


I''m getting an error message with that. Here is what I did (I had already figured out the self.lhs = lhs and I got it to print... but not right).

Expand|Select|Wrap|Line Numbers


I''m getting an error message with that. Here is what I did (I had already figured out the self.lhs = lhs and I got it to print... but not right).

Expand|Select|Wrap|Line Numbers


这篇关于重载__add__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆