0

Challenge Question Bug

nums = {1, 2, 3, 4, 5, 6} nums = {0, 1, 2, 3} & nums nums = filter(lambda x : x > 1, nums) print(len(list(nums))) Traceback (most recent call last): File "E:\python_codes\challenges.py", line 167, in <module> print(len(list(nums))) TypeError: 'list' object is not callable

7th Feb 2022, 10:17 AM
amirhs
amirhs - avatar
3 Réponses
+ 2
How can that error message point at line 167? there barely 5 lines of code there. Did you shadow the list() function (by using 'list' as variable name maybe) somewhere in the actual code?
7th Feb 2022, 11:36 AM
Ipang
7th Feb 2022, 10:20 AM
A͢J
A͢J - avatar
+ 1
Challenge Question Bug num = {1, 2, 3, 4, 5, 6} num2= {0, 1, 2, 3} alist=num&num2 res =list( filter(lambda x : x > 1, alist)) print(len(res))
7th Feb 2022, 10:27 AM
Jasy Fabiano
Jasy Fabiano - avatar