- 5
Fill in the blanks to extract all items that are less than 5 from the list. nums = [1, 2, 5, 8, 3, 0, 7] res = list( filter
help
4 ответов
+ 11
Jack Bradshaw , this is one of the quizzes for filter() function. Just go back one step and read the description how this filter function is working. If you struggle by using the lambda, you can also see how this works.
+ 4
Jack Bradshaw , if I may offer a suggestion, I think you may be trying to learn too fast. I would start over at the beginning of the lessons and work your way through them slowly. Take your time. Practice writing your own codes for every new concept. If anything doesn't make sense, see if you can find help in the lesson comments. Use Google a lot. It helps to see each new concept from several different viewpoints, so I suggest looking them up in a few tutorials, for example,
https://www.programiz.com/JUMP_LINK__&&__python__&&__JUMP_LINK-programming
https://www.learnpython.org
https://docs.python.org/3.8/tutorial/
It's a slower process but it's worth it because the knowledge you get will stick.
If you're still stuck, then ask for help. The folks here love to help 😊
Good luck!
+ 2
nums = [1, 2, 5, 8, 3, 0, 7]
res = list( filter (lambda x: x < 5, nums))
print(res)
0
That is good