Ifnbspcasesensitivenbspisnbspfalse then it should accept


Reimplement your get_user_input() function from Lab #6 so that it takes an optional second argument, a boolean called case_sensitive. If case_sensitive is True, then the function should only accept the user's input if it exactly matches one of the strings in the given list. If case_sensitive is False, then it should accept the user's input if it case-insensitively matches an item in the list. If the second argument is omitted, it should default to behaving case insensitively.

So for example, get_user_input(["yes", "no", "maybe"], True) would accept yes, but not YES. But get_user_input(["yes", "no", "maybe"], False) and get_user_input(["yes", "no", "maybe"]) would both accept either yes or YES.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Ifnbspcasesensitivenbspisnbspfalse then it should accept
Reference No:- TGS02203239

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)