Define a function remainpos

Assignment Help Business Management
Reference no: EM132162274

Define a function remainPos(...)  which receives one string (st) (with letters, digits or special characters),one character (ch), and one digit (dig) (the digit will be greater or equal than 2, and clearly, since it is a digit, it will be less or equal than 9). Teh function should return a NEW STRING containing possibly several digits, separated by two dots. These digits in the returned string each are the remainder of dividing each position where the character (ch) is found by the digit (dig). Each remainder will be separated by two dots (and at the start and end of the string to be returned there should also be two dots). If the character ch  is the not present in the original string, then the function should return a string containing only two dots.

For example, 

s = "abc-abc-abc-abc-"

c = "a"

d = 3

giveMeRemainPos(s,c,d)

will cause the function to return the string '..0..1..2..0..' because the character "a" is in positions 0,4,8,12 in the string s, and respectively, the remainders of dividing such positions by d (= 3) will produce the values 0,1,2,0 

As an example, the following code fragment:

s = "abc-abc-abc-abc-"

c = "a"

print(remainPos(s,c,3))

should produce the output:

..0..1..2..0..

Reference no: EM132162274

Questions Cloud

Determine the advantages of the adoption of the hitech : Analyze the primary ways in which the key federal initiatives impact the standards of health care information for patient privacy.
Extended period of time up to five years : A claim-made policy can be endorsed for an extended period of time up to five years. If you were an insured would you buy an extension?
How would you evaluate your effort : What aspects of the innovation would be important to highlight in educating the public? Who would you expect to include in each of the groups?
Compute the rate of return on the investment : Question - Compute the rate of return on the investment characterized by the following cash flow
Define a function remainpos : Define a function remainPos(...) which receives one string (st) (with letters, digits or special characters),one character (ch), and one digit (dig)
Determine three value-added support strategies : Determine three value-added support strategies that the organization you researched would need to achieve its mission.
Determine the rate of return on the investment : Question - Given the following cash flow, determine the rate of return on the investment
How can an organization protect itself : How can an organization protect itself from Port Scanning and when can it do so? When is it not possible?
Provide examples of three value-added support strategies : Provide examples of three value-added support strategies geared toward helping a nursing home to implement a goal.

Reviews

Write a Review

Business Management Questions & Answers

  Calculate the opportunity cost

Calculate the opportunity cost and show the answer and the calculation. Should the company ask Bill to make the extra clutches or not?

  Differences between self-centered and god-centered ambition

Using the book Spiritual Leadership please help me answer these questions. 1. What did you learn about J. Oswald Sanders and how are his experience and education relevant to what he wrote? 2. How would you illustrate the differences betwe..

  Leadership important to early careerists

Why is the study of leadership important to early careerists in the health industry? What are the challenges in the industry that require quality leadership?

  Demonstrate ethical scholarship in accurate representation

Demonstrate ethical scholarship in accurate representation and attribution of sources; and display accurate spelling, grammar, and punctuation.

  Difference between southwest and delta

Show what is the difference between Southwest, Delta, American and those that have perished: Braniff, TWA, and Pan Am?

  Countries of the world been struggling

Why have so many countries of the world been struggling (Brazil, Russia, Venezuela, Japan, etc.)?

  Strategic planning and the strategic planning process

How often should we engage in strategic planning and the strategic planning process?

  Impact of a change in a constraint coefficient

The first four questions are true and false 1. In order to tell the impact of a change in a constraint coefficient, the change must be made and then the model resolved.

  Concepts of the johari window and transactional analysis

For this assignment you will be applying the concepts of the Johari Window and Transactional Analysis to some specific scenarios that you might face if you were a leadership development coach. Of course make sure to thoroughly review the required ..

  Who are the leaders of the organization

The organizational analysis will utilize a minimum of five external, What is the organization and how would you describe it?

  A casual vacancy in the office of auditor arises

If a casual vacancy in the office of auditor arises by his resignation it should only be filled by the company in a........ a) Board meeting b) extraordinary general meeting c) General meeting d) annual general meeting 12.For the purposes of s..

  Ehr and several management systems

Clerks, nurses, and physicians will all input information to the EHR and several management systems.

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