|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 歌者文明清理员 于 2023-7-24 17:08 编辑
三个gpt脚本都被骗了
居然还有一个删了帖子
抱歉,文件目录过于复杂,用附件了
gpt就是垃圾
为啥??????咋又是这个问题???
gpt垃圾
code.zip
(3.32 KB, 下载次数: 4)
- print(heavier, lighter)
- print(heavier == lighter,star1 == star2)
- print(heavier is sprite1,lighter is sprite1)
- print(heavier is star2)
复制代码
加了点print
结果:
- planet3 planet3
- True False
- True True
- False
复制代码
很明显是因为你改变了heavier的什么东西,所以它不再is star2 了
这边建议改成这样:
- heavier = sprite1 if star1.mass > star2.mass else sprite2
- lighter = sprite2 if heavier is sprite1 else sprite1
复制代码
结果打印:
- planet3 planet2
- False False
- True False
- False
复制代码
显示屏上的也是对的,应该就可以了
@歌者文明清理员
|
|