Not Not Not True

Published by Matt in

Something which is not true is false, but something which is not not true is true! Create a function where given n number of "not", evaluate whether it's true or false.

Examples

not_not_not(1, true) ➞ false
# Not true.

not_not_not(2, false) ➞ false
# Not not false.

not_not_not(6, true) ➞ true
# Not not not not not not true.

Notes

Even though this challenge can be easily solved through the use of an if | else block, you might want to solve it through the use of a Boolean Logic Operator or a Bitwise Operator, taking the opportunity to become acquainted with these methods (check the Resources tab to find specific links).

Watch a quick demo on how Edabit works.