Skip to content

Latest commit

 

History

History
46 lines (27 loc) · 1019 Bytes

L1_Set_Alarm.md

File metadata and controls

46 lines (27 loc) · 1019 Bytes

CodeWars Python Solutions


L1: Set Alarm

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

For example

setalarm(true, true) -> false
setalarm(false, true) -> false
setalarm(false, false) -> false
setalarm(true, false) -> true

Given Code

def set_alarm(employed, vacation):
    pass

Solution

def set_alarm(employed, vacation):
    return True if employed and not vacation else False

See on CodeWars.com