geekcomputers / geekcomputers/Python
Getting error object not callable in my program
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 35.4k
- 派生
- 12.9k
- 平均合并
- 2 小时 37 分钟
- 30 天内合并 PR
- 1
描述
OS : Windows 7
Python 2.7
total=0
temp =0
i=0;
j=1;
counter=0
MIN_val = 100
MAX_val = 0
file = open("C:/Users/Shrikanth/Desktop/Report.csv")
csv_reader = csv.reader(file)
next(csv_reader)
for all in csv_reader:
FileName, Channel, OrgSize, TransSize = all
if Channel == "TimesNow_LB":
total_redn= (float(OrgSize)- float(TransSize))/float(OrgSize) * 100
counter = counter + 1
MIN_val(float(total_redn))
MAX_val(float(total_redn))
AVG_val(float(total_redn))
print counter
def MIN_val(num):
global MIN_val
if MIN_val > num:
MIN_val = num
print MIN_val
def MAX_val(num):
global MAX_val
if MAX_val < num:
MAX_val=num
print MAX_val
So i'm getting ''MIN_val(float(total_redn))
TypeError: 'int' object is not callable'' error.
Why does it happen and what is the solution?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未识别出任何仓库文件或测试。使用 Python 2.7 重现所提供的代码片段,然后检查 MIN_val 和 MAX_val 的赋值、函数定义以及调用;当示例在没有报告的 TypeError 的情况下运行,并产生预期的最小值和最大值时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 15/100