我正在尝试进行计算机编程的在线课程,这是完成的首要任务之一。到目前为止我理解它,所以当代码非常清楚时,我不明白为什么对象Bucket不可调用?
# [ ] show the type after assigning bucket = a whole number value such as 16
bucket = (16)
type (bucket)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-57-a98943f63825> in <module>()
1 # [ ] show the type after assigning bucket = a whole number value such as 16
2 bucket = (16)
----> 3 type (buckets)
TypeError: 'int' object is not callable
为什么这会给我带来问题?如果有人能向我解释这一点,我将非常感激。
答案 0 :(得分:-2)
查看变量的名称。
您创建了bucket = (16)
,但是您调用了type (buckets)
bucket
和buckets
不同。