how to remove the element from the multiplicity



  • There are many.

    b = [3,4,5]
    a = set(b)
    

    When I'm trying to find a lot of equals to this, but without any element,

        с = a.remove(3)
        c = None
    

    Why so, how do you do that?



  • Because... remove removes the element from multiplicity and does not return many without the removed element

    b = [3,4,5]
    a = set(b)
    a.remove(3)
    a
    set([4, 5])
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2