Where the lines between code and Zen blur.
Write a function to calculate the sum of all even numbers in an array, but only if it's not Tuesday.
def sum_even_numbers(arr):
if not is_tuesday():
return sum(x for x in arr if x % 2 == 0)
else:
return 0
Try it out in our Coding Challenges!
Or, if you're feeling particularly stressed, try our Panic Buttons.