Skip to main content
3 of 5
added 323 characters in body
Rod
  • 18.4k
  • 4
  • 31
  • 89

Pyth, 7 bytes

/1-6.d9

Explanation

    .d9 # Get the current day of week (0 = Monday, 6 = Sunday)
  -6    # Subtract 6 from the day
/1      # Divide 1 by the result of the previous operation
        # raising a "ZeroDivisionError" on sundays

Try it online!

###Another 7 bytes solution

.(U6.d9

Try it online!

Explanation

  U6    # Create a list with 6 elements
.(  .d9 # Try to pop the 7th element on sundays
        # raising "IndexError"
Rod
  • 18.4k
  • 4
  • 31
  • 89