Default to behaving case insensitively

Assignment Help Basic Computer Science
Reference no: EM131406611

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.

Reference no: EM131406611

Questions Cloud

Discuss creation and configuration of organizational units : Discuss the creation and configuration of Organizational Units. Discuss procedures for installing Domain Controllers. Discuss the differences when you are installing to an existing Domain and when you are creating a new domain.
Write about the latest developments and issues : Choose any topic related to the course and write about the latest developments and issues.Use at least five references outside of your textbook (you may use your textbook too, but are not required to).In addition to the required number of pages for t..
Supply chain risk in the cybersecurity industry : For this paper, you will research and report upon the problem of Supply Chain Risk as it pertains to the cybersecurity industry. You will also investigate due diligence and other business processes / strategies which can be used to mitigate the im..
What type of strategies should hr management adopt : Define workplace violence. What type of strategies or interventions should HR management adopt to protect employees while at work?
Default to behaving case insensitively : 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.
Define a function called : Define a function called skip_string() that takes a string (call it string) and an optional positive integer (call it skip_amount). The function should return a string that starts with the first character in string, and then skips skip_amount char..
Sequence of numbers and an optional minimum value : Define a function called all_above(), which takes a sequence of numbers and an optional minimum value, and determines if every number in the sequence is larger than the given minimum value.
Determine the mean squared distortion : The objective of this problem is to use MATLAB to design a 10-level Lloyd-Max (nonuniform) quantizer for a zero-mean, unit-variance Gaussian source.
Identify the main business actors : 1. Identify the main business actors. 2. Using the Gane and Sarson symbols, draw a context and a level- 0 diagram for the narrative above.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is meant by the term nested if/else instructions

Give at least one example of a nested IF/ELSE instruction using pseudo code and flowcharts to describe your answer.

  Design a physical data model incorporating

Design a physical data model incorporating U.I.D. number, student name, faculty name, attempted course, course taught, acceptance date, and grade achieved as an entity in the illustration.

  Propose an idea to control and prevent the erosion

Propose an idea to control and prevent the erosion, and to save your seaside home from falling into the ocean. Try to think of an idea that will be feasible to actually carry out, and post your idea to the discussion board.

  How do the problem-domain classes map

How do the problem-domain classes map to the selected format - What techniques would best optimize the design's processing efficiency?

  Find the names of all branches located in chicago

Find the names of all borrowers who have a loan in branch "Downtown".

  Write an anonymous block that places a substitution variable

Write an anonymous block that places a substitution variable (&) into a local variable of type character. You should check the value entered in the local variable and output different messages depending on the value provided.

  An ability to utilise

An ability to utilise sources such as the Internet and University library facilities to search, locate and summarise data relevant to the assignment

  What basic steps are required for analyzing data using micro

Write a 200 word response that answers the following questions: What basic steps are required for analyzing data using Microsoft®Access®? How could these steps help you diagnose and troubleshoot Microsoft®Access®errors? Which of the five steps presen..

  Sum-of-products representation

Run the program using step mode. Put the code inrto the online assignment area. Also indicate the new contents of the register affected by each instruction. For this you need to use the step mode.

  Problem regarding the matrix tensile strength

Compute the longitudinal strength of an aligned carbon fiber-epoxy matrix composite having a 0.25 volume fraction of fibers,assuming the following:

  Memory segment in terms of its start address

The above segment descriptor describes a memory segment in terms of its start address, its size and whether it is ALLOCATED or FREE. This descriptor is part of a list (contains a pointer to next segment descriptor). Initially, there is only one se..

  Devise some code to insert data in inversely sorted order

Devise some code to insert data in inversely sorted order (99,999, 99,998, 99,997, ...) into bubbleSort.java. Use the same amount of data as in Experiment 1. See how fast the sort runs compared with the random data in Experiment 1. Repeat this exp..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd