Python Forum
Why is this function returning none?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why is this function returning none?
#3
Bitwise operators come in handy here as you are looking for an exclusive or:

def in1to10(n, outside_mode=False):
    return (1 <= n <= 10) ^ outside_mode
I am trying to help you, really, even if it doesn't always seem that way
Reply


Messages In This Thread
Why is this function returning none? - by wlsa - Sep-30-2018, 05:01 AM
RE: Why is this function returning none? - by gruntfutuk - Sep-30-2018, 01:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can anyone spot why this function is returning an empty list? hhydration 2 1,891 Nov-18-2020, 06:16 AM
Last Post: deanhystad
  Function not returning correct value TsG009 4 4,201 Nov-24-2017, 09:07 PM
Last Post: sparkz_alot
  Function for returning absolute numbers Ernstblack 2 3,247 Oct-02-2017, 05:48 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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