Skip to content

Commit

Permalink
Add back in accidentally deleted function
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymi306 committed Jan 28, 2024
1 parent 889227b commit 4b6a9d9
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion app/pages/first_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,26 @@ def futures_try_int_input(mocked_input_ret):
print(my_number * 2)
# END


def conditions_names(mocked_input_ret):
"""
>>> Codeblocks.conditions_names('Joshua')
Greetings. Would you like to play a game?
>>> Codeblocks.conditions_names('Dave')
I'm sorry, Dave. I'm afraid I still can't open the podbay doors.
>>> Codeblocks.conditions_names('foobarbaz')
Hello, foobarbaz
"""
with patch('builtins.input') as input:
input.return_value = mocked_input_ret
# START
user_input = input('What\'s your name?')
if user_input == 'Joshua':
print('Greetings. Would you like to play a game?')
elif user_input == 'Dave':
print("I'm sorry, Dave. I'm afraid I still can't open the podbay doors.")
else:
print('Hello, ' + user_input)
# END


# pylint: disable=using-constant-test
Expand Down

0 comments on commit 4b6a9d9

Please sign in to comment.