File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments