5

This is my code:

import time
a = time.daylight()
print(a)

It results in:

TypeError: 'int' object is not callable.

What is the problem?

3
  • 1
    Just remove the parens Commented Aug 27, 2013 at 2:08
  • you can use print(type(time.daylight)) and it'll tell you want kind of type the attribute is. If it's a function, then you can call it with your parans () Commented Aug 27, 2013 at 4:40
  • possible duplicate of TypeError: 'int' object is not callable Commented Dec 8, 2014 at 17:30

1 Answer 1

6

time.daylight is a number; do not attempt to call it by putting parentheses at the end.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.