zoukankan      html  css  js  c++  java
  • 'str' object is not callable

    >>> b=str(11)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: 'str' object is not callable

    原因:定义变量的时候,随机使用str,所以就被覆盖了str函数。可以退出重进python或者del掉自定义str变量。

    python中内置了很多的函数和类,在自己定义变量的时候,切记不要覆盖或者和他们的名字重复

    >>> del str
    >>> str(122)
    '122'
  • 相关阅读:
    Spring----Day03
    Spring----Day02
    python
    python
    python
    python
    python
    python
    python
    python
  • 原文地址:https://www.cnblogs.com/dadadechengzi/p/6214844.html
Copyright © 2011-2022 走看看