Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8495701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:38:45+00:00 2026-06-10T23:38:45+00:00

I am learning the concept of filters in Python. I am running a simple

  • 0

I am learning the concept of filters in Python. I am running a simple code like this.

>>> def f(x): return x % 2 != 0 and x % 3 != 0
>>> filter(f, range(2, 25))

But instead of getting a list, I am getting some message like this.

<filter object at 0x00FDC550>

What does this mean? Does it means that my filtered object i.e list to come out is stored at that memory location? How do I get the list which I need?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:38:46+00:00Added an answer on June 10, 2026 at 11:38 pm

    It looks like you’re using python 3.x. In python3, filter, map, zip, etc return an object which is iterable, but not a list. In other words,

    filter(func,data) #python 2.x
    

    is equivalent to:

    list(filter(func,data)) #python 3.x
    

    I think it was changed because you (often) want to do the filtering in a lazy sense — You don’t need to consume all of the memory to create a list up front, as long as the iterator returns the same thing a list would during iteration.

    If you’re familiar with list comprehensions and generator expressions, the above filter is now (almost) equivalent to the following in python3.x:

    ( x for x in data if func(x) ) 
    

    As opposed to:

    [ x for x in data if func(x) ]
    

    in python 2.x

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning now JS but get so often this concept of initiating a
Learning some VBA. So far, I've constructed this piece of code which should allow
I am learning the concept of sequence and nil in Clojure. This was the
As I'm currently learning Django / Python, I've not really been using the concept
I start learning some java concurrency concept ans put in use. But one of
I'm currently learning WPF and have stumbled upon the concept of weak events but
I started learning XML yesterday but I cant get around the concept of DTD.
I'm learning pointers and references but I'm having trouble grasping the concept. I need
I understand the concept behind DI, but I'm just learning what different IoC containers
I am learning OOPS concept and also using PDO , but really stuck in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.