“类型错误:‘浮动’”对象不可迭代”在部门列表中
我正在尝试制作一个程序来搜索服务器并找到其中有玩家的服务器,问题是服务器被分成组,例如:pages = (#servers / maxPlayers) 。我能够通过以下方式获取服务器数量:round(playing / maxPlayers)
,它正在工作,但由于某种原因,每当我尝试使用它时:for server在servers / round(maxPlayers):
中,它给了我“TypeError:‘float’对象不可迭代”。我在这里遇到了很多同样的问题,但没有一个对我有帮助。任何帮助我们都会感激不尽,这不是开玩笑,我已经花了大约 30 分钟的时间来尝试解决这个问题。
I'm trying to make a program that searches through servers and finds a server with a player in it, the problem is the servers are split in to groups, like: pages = (#servers / maxPlayers). I was able to get the number of servers through: round(playing / maxPlayers)
, which is working but for some reason whenever I try using this: for server in servers / round(maxPlayers):
it gives me "TypeError: 'float' object is not iterable". I have gone through so many of these same questions on here and none of them have helped me. Any help will be literally appreciated no joke I have been working on trying to fix this for like 30 minutes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该循环使用:
You should loop using: