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

  Create a new sequential search method

The sequential search algorithm will always find the first occurrence of an item in a data set. Create a new sequential search method that takes a second integer argument indicating which occurrence of an item you want to search for.

  Determine the best e-mail policy for an organization

Explain the use of virtual private networks (VPNs) and their security benefits and drawbacks.

  Describe the advantages of using project milestones

Why should extra effort be expended to meet a milestone when the final project's due date is months away?

  What are the pro and con of digital rights managment

What are the pro's and con's of Digital Rights Managment?

  Describe the characteristics of the near field

Describe the characteristics of the near field. Why is the near field less important for antenna analysis than the far field?

  Design modular program asks how many tickets each class

There are three seating categories at a stadium

  Primarily a product survey of a small system

Primarily a product survey of a small system that would have the specifications to meet the requirements of an a financial investment or architectural firm

  Create a loop or event to keep something moving

The Alice local object gallery has a cannon that you could use. You might create a loop or event to keep something moving, and try to hit it with an object fired from the cannon.

  Values on the other side

Solve the equation -24x - 4y + 32 = 0 for y. Hint: Remember to do this we have to get the y by itself on one side of the equation and all the other values on the other side

  Climate of continuous change

In a climate of continuous change, organizations must constantly adapt to survive even while unceasing demands to adapt can create change fatigue and resistance among personnel. (Torppa & Smith, 2011). What change fatigue?What do you think this me..

  State the reciprocal ratios of sine cosine and tangent

Compare sin A and cos B, csc A and sec B, and tan A and cot B.

  On the spot courier services

On the Spot Courier Services On the Spot courier services grew and changed over the years. At first, Bill received requests for package pickups on his mobile phone, recorded that informa¬tion in a log, and would then drive around to retrieve all the ..

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