'float'/'int'对象不可迭代 [英] 'float' / 'int' object is not iterable

查看:134
本文介绍了'float'/'int'对象不可迭代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试计算无限系列的总和

S =总和(从n = 0到100)1 / k!

我收到消息''浮动''/''int''对象不可迭代。我怎么解决这个问题?

I try to calculate the sum of an infinite series
S = Sum (from n=0 to 100) 1/k!
I got message ''float'' / ''int'' object is not iterable. How can I fix this?

推荐答案


我试着计算一个无限系列的总和

S = Sum(从n = 0到100)1 / k!

我收到消息''float''/''int''对象不可迭代。我怎样才能解决这个问题?
I try to calculate the sum of an infinite series
S = Sum (from n=0 to 100) 1/k!
I got message ''float'' / ''int'' object is not iterable. How can I fix this?



嗯...我以前从未见过这样的语法..首都S在总和中应该抛出纯Python中的第一个错误。 ...然后你的帖子中缺少CODE标签..

Hmmm... I''ve never seen syntax like that before.. The capital "S" in "Sum" should have thrown the first error in pure Python. ...Then there is the lack of CODE tags in your post..

展开 | 选择 | Wrap | 行号



我尝试计算无限系列的总和

S =总和(从n = 0到100)1 / k!

我得到消息''float''/''int''对象不可迭代。我怎样才能解决这个问题?
I try to calculate the sum of an infinite series
S = Sum (from n=0 to 100) 1/k!
I got message ''float'' / ''int'' object is not iterable. How can I fix this?



无限,是吧?必须有一些限制:

Infinite, huh? There''s got to be some limit:

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号



无限,是吗?必须有一些限制:
Infinite, huh? There''s got to be some limit:
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


这篇关于'float'/'int'对象不可迭代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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