Skip to content

Commit af22bb6

Browse files
committed
Add back in accidentally deleted function
1 parent 889227b commit af22bb6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

app/pages/first_steps.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,26 @@ def futures_try_int_input(mocked_input_ret):
142142
print(my_number * 2)
143143
# END
144144

145-
145+
def conditions_names(mocked_input_ret):
146+
"""
147+
>>> conditions_names('Joshua')
148+
Greetings. Would you like to play a game?
149+
>>> conditions_names('Dave')
150+
I'm sorry, Dave. I'm afraid I still can't open the podbay doors.
151+
>>> conditions_names('foobarbaz')
152+
Hello, foobarbaz
153+
"""
154+
with patch('builtins.input') as input:
155+
input.return_value = mocked_input_ret
156+
# START
157+
user_input = input('What\'s your name?')
158+
if user_input == 'Joshua':
159+
print('Greetings. Would you like to play a game?')
160+
elif user_input == 'Dave':
161+
print("I'm sorry, Dave. I'm afraid I still can't open the podbay doors.")
162+
else:
163+
print('Hello, ' + user_input)
164+
# END
146165

147166

148167
# pylint: disable=using-constant-test

0 commit comments

Comments
 (0)