Python Forum
counting characters in an object
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
counting characters in an object
#11
why is it so hard to use a lambda in such a case?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#12
There is no point in wrapping o.__contains__ in lambda x: x in o, apart from having a less efficient code. Another reason for the existence of __contains__ in python is to define a custom in operator for a user defined class.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Remove escape characters / Unicode characters from string DreamingInsanity 5 955 May-15-2020, 01:37 PM
Last Post: snippsat
  Counting number of characters in a string Drone4four 1 1,271 Aug-16-2018, 02:33 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020