Reference no: EM13929040
* Python Program
Write and test the following function:
def mirror(s, v, m, m):
"""
-------------------------------------------------------
Determines if s is a mirror of characters in v around the pivot m.
Use: r = mirror(s, v, m)
-------------------------------------------------------
Preconditions:
s - a string (str)
v - a string of valid characters (str)
m - the mirror pivot string (str not in v)
Postconditions:
returns
is_mirror - True if s is a mirror, False otherwise (bool)
-------------------------------------------------------
"""
A mirror has the following pattern: LmR where L is a (possibly empty) string formed from the letters of a string, and R is the reverse of the string L. m is an pivot string whose characters are not in L or R. For example, the following strings have the abc mirror pattern: "m", "abacmcaba", "cmc", "bbaamaabb". The following strings do not have the abc mirror pattern: "abmb", "gmg", "abacmcabb".
Examples:
>>> print(mirror('abcmcba', 'abc', 'm'))
True
>>> print(mirror('cmc', 'c', 'm'))
True
>>> print(mirror('bbaattaabb', 'ab', 'tt'))
True
>>> print(mirror('abmb', 'ab', 'm'))
False
>>> print(mirror('gmg', 'ab', 'm'))
False
>>> print(mirror('atta', 'at', 'tt'))
False
Evaluate the use of a distributed database management system
: Evaluate the use of a Distributed Database Management System (DDBMS). As with most things, there are numerous advantage and many disadvantages. Evaluate and rank them. What would be good situations to use a DDBMS and why?
|
Understanding financial statements
: Write a 750- to 1,050-word paper evaluating the financial health of a company. Highlight the importance of industry comparisons and trends.
|
Characteristic shared and inherited from a common ancestor
: What term is used to indicate a characteristic that is shared and inherited from a common ancestor?
|
Here a median is the middle element of a sorted list
: Here a median is the middle element of a sorted list if the number of elements is odd, and the average of the two middle elements if the number of elements is even. You may use Python's built-in sort method to sort the contents of the list after they..
|
String formed from the letters of a string
: A mirror has the following pattern: LmR where L is a (possibly empty) string formed from the letters of a string, and R is the reverse of the string L. m is an pivot string whose characters are not in L or R. For example, the following strings have t..
|
How communication involved in carrying out these strategies
: Identify and analyze three strategies you feel are critical to for leaders to apply when facilitating collaborative sessions. How is communication involved in carrying out these strategies?
|
How cloud based office productivity software is different
: Remember to state business problem, articulate the current setup, explain how cloud based office productivity software is different, and how it benefit the business
|
Problem regarding the accounting software memo
: Your department's accounting software is extremely outdated and you have included the purchase of new software in this year's fiscal budget. You have decided it is time to start looking into purchasing your company's accounting software and have c..
|
What is the book value of the asset at the time of sale
: How would the sale affect the amount of total assets shown on the balance sheet (increase, decrease, no effect) and by how much?
|