Dec-26-2018, 05:02 PM
(This post was last modified: Dec-26-2018, 05:03 PM by Gribouillis.)
What about
def lesser_of_two_evens(a, b): return sorted((a, b))[(a | b) & 1]
Functions with conditionals and comparison operators
|
Dec-26-2018, 05:02 PM
(This post was last modified: Dec-26-2018, 05:03 PM by Gribouillis.)
What about
def lesser_of_two_evens(a, b): return sorted((a, b))[(a | b) & 1] |
|
Messages In This Thread |
Functions with conditionals and comparison operators - by Drone4four - Dec-20-2018, 03:26 PM
RE: Functions with conditionals and comparison operators - by ichabod801 - Dec-20-2018, 03:49 PM
RE: Functions with conditionals and comparison operators - by buran - Dec-20-2018, 04:36 PM
RE: Functions with conditionals and comparison operators - by Drone4four - Dec-26-2018, 01:28 PM
RE: Functions with conditionals and comparison operators - by stullis - Dec-26-2018, 04:47 PM
RE: Functions with conditionals and comparison operators - by Gribouillis - Dec-26-2018, 05:02 PM
RE: Functions with conditionals and comparison operators - by Drone4four - Dec-30-2018, 01:48 AM
RE: Functions with conditionals and comparison operators - by buran - Dec-27-2018, 09:32 PM
RE: Functions with conditionals and comparison operators - by stullis - Dec-30-2018, 02:18 AM
RE: Functions with conditionals and comparison operators - by Drone4four - Jan-01-2019, 06:48 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Meltdown Mitigation (operators + conditionals) beware: Exercism potential spoiler | Drone4four | 5 | 2,692 |
Feb-21-2022, 08:49 AM Last Post: Gribouillis |
|
Need help with a homework problem on logical operators | voodoo | 3 | 4,627 |
Jun-28-2019, 03:45 PM Last Post: jefsummers |
|
Guessing game with comparison operators | Drone4four | 9 | 13,864 |
Dec-02-2018, 06:12 PM Last Post: ichabod801 |
|
Nested Conditionals | Elero | 3 | 7,975 |
Apr-16-2018, 07:58 PM Last Post: Elero |
|
Error with conditionals | RiceGum | 17 | 7,312 |
Oct-18-2017, 01:45 AM Last Post: ichabod801 |