geekcomputers / geekcomputers/Python

Getting error object not callable in my program

Open
#212 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
35.4k
Forks
12.9k
Avg merge
2h 37m
Merged PRs (30d)
1

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is identified. Reproduce the supplied snippet under Python 2.7, then inspect the MIN_val and MAX_val assignments, function definitions, and calls; done means the example runs without the reported TypeError and the intended minimum and maximum values are produced.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.