DNPotapov / Codewars-katas-

0 stars 0 forks source link

L1: Set Alarm (8 kyu) #12

Open DNPotapov opened 1 year ago

DNPotapov commented 1 year ago
def set_alarm(employed, vacation):
    return True if (employed and not vacation) else False
DNPotapov commented 1 year ago

Write a function named setAlarm which receives two parameters. The first parameter, employed, is true whenever you are employed and the second parameter, vacation is true whenever you are on vacation.

The function should return true if you are employed and not on vacation (because these are the circumstances under which you need to set an alarm). It should return false otherwise. Examples:

setAlarm(true, true) -> false setAlarm(false, true) -> false setAlarm(false, false) -> false setAlarm(true, false) -> true

DNPotapov commented 1 year ago

https://www.codewars.com/kata/568dcc3c7f12767a62000038