Python method calls: Why dict.items needs parentheses

Python method calls: Why dict.items needs parentheses

Python gotcha: Forgetting () on method calls!

d = {'a':2, 'b':4}
list(d.items()) # ✅ calls method
list(d.items)   # ❌ passes method object

Result:

Error: ‘builtin_function_or_method’ object is not iterable

Remember: () calls the method!