Getting a type error when I try to use the sum function

Here is my code:

even = (i for i in range(20) if i % 2 == 0) sum(even) 

When I try to run it, I get the following error, instead of getting 90:

TypeError: ‘int’ object is not callable

What did I do incorrectly in my code?

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.