Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
1 in (True,)
#1
Output:
>>> 1 in (True,) True
i finally got a round tuit and tested this. and it was so simple to test. what i need to do is make my own function perhaps named isin() to do the in operation using the is operator instead of the == operator that the real in operator apparently does for use when the exact matches are needed. i should check my old code for any cases where it is needed.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
operator.contains() already does isin() 's job.
Skaperen likes this post
Reply


Forum Jump:

User Panel Messages

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