首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >python AttributeError:模块‘AttributeError’没有属性'comb‘

python AttributeError:模块‘AttributeError’没有属性'comb‘
EN

Stack Overflow用户
提问于 2021-04-16 16:12:08
回答 1查看 3.1K关注 0票数 2

当我尝试使用'comb‘函数时,我得到了一个错误:

代码语言:javascript
复制
$ python
Python 3.7.1 (default, Dec 14 2018, 13:28:58) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> print(math.comb(6,49))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'math' has no attribute 'comb'
>>> 
EN

回答 1

Stack Overflow用户

发布于 2021-04-16 16:31:49

comb函数是Python3.8中的新功能(请参阅文档here)。您的Python安装版本是3.7.1。如果您更新您的Python安装,这个问题应该会得到解决。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67121494

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档