TypeError: 'list' object is not callable in python

Joined
Sep 25, 2009
Messages
1
Reaction score
0
my teacher gave us an excersice to do for python. it looks like this

empnamelist=["bobby brown","jimmy john","ronald mcdonald","burger king","papa johns"]
def empnamecheck():
pointer=0
while pointer<=len(empnamelist()):
while match !=false:
if name==emmnamelist[pointer]:
match=true
pointer=pointer+1

def hours():
hours=input('how many hours did you work?:')
return hours

def payrate():
payrate=input('how much is the payrate?:')
return payrate

def calchours(pr,h):
if h>40:
rh=40
oh=h-40
else:
rh=h
oh=0
print 'pay rate $%o.2f' % pr
print 'regular hours %d' % rh
print 'overtime hours %d' % oh
print 'regular pay $%0.2f' % (rh*pr)
print 'overtime pay $%0.2f' % (oh*pr*1.5)
print 'total pay $%0.2f' % (rh*pr+oh*pr*1.5)

def main():
name=raw_input('enter the employees name as firstname lastname:')
empnamecheck()

hrs=hours()
pyr=payrate()
calchours (pyr,hrs)

main()



and im getting this error

Traceback (most recent call last):
File "C:/Users/Johnny/Desktop/payroll.py", line 41, in <module>
main()
File "C:/Users/Johnny/Desktop/payroll.py", line 35, in main
empnamecheck()
File "C:/Users/Johnny/Desktop/payroll.py", line 4, in empnamecheck
while pointer<=len(empnamelist()):
TypeError: 'list' object is not callable

what am i doing wrong? :/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top