【CodingBat】练习1——Warmup_1--sleep_in--

题目:

The parameter weekday is True if it is a weekday, and the parameter vacation is True if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return True if we sleep in.

要求的输出:
sleep_in(False, False) → True
sleep_in(True, False) → False
sleep_in(False, True) → True

 

已给出的程序:

def sleep_in(weekday, vacation):

 

.

.

.

.

.

.

完整程序(已验证):

def sleep_in(weekday, vacation):
  if not weekday or vacation:
    return True
  else:
    return False

【CodingBat】练习1——Warmup_1--sleep_in--_第1张图片

 

你可能感兴趣的:(python学习)