-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bob: sync expected test results and input data with problem-specifica…
…tions (#1784) * Bob: sync expected test results and input data with problem-specifications.
- Loading branch information
1 parent
ec506df
commit bb681f9
Showing
3 changed files
with
41 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
def hey(phrase): | ||
def response(hey_bob): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
def hey(stimulus): | ||
stimulus = stimulus.strip() | ||
def response(hey_bob): | ||
hey_bob = hey_bob.strip() | ||
|
||
if _is_silence(stimulus): | ||
if _is_silence(hey_bob): | ||
return 'Fine. Be that way!' | ||
if _is_shouting(stimulus): | ||
if _is_question(stimulus): | ||
if _is_shouting(hey_bob): | ||
if _is_question(hey_bob): | ||
return "Calm down, I know what I'm doing!" | ||
else: | ||
return 'Whoa, chill out!' | ||
elif _is_question(stimulus): | ||
elif _is_question(hey_bob): | ||
return 'Sure.' | ||
else: | ||
return 'Whatever.' | ||
|
||
|
||
def _is_silence(stimulus): | ||
return stimulus == '' | ||
def _is_silence(hey_bob): | ||
return hey_bob == '' | ||
|
||
|
||
def _is_shouting(stimulus): | ||
return stimulus.isupper() | ||
def _is_shouting(hey_bob): | ||
return hey_bob.isupper() | ||
|
||
|
||
def _is_question(stimulus): | ||
return stimulus.endswith('?') | ||
def _is_question(hey_bob): | ||
return hey_bob.endswith('?') |