1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dlinn [17]
3 years ago
11

Write function modifyString(origString, charsToReplace, count) that takes as input a string origString, a string charsToReplace,

and a positive integer count, and returns a new string such that each character in origString that occurs in charsToReplace is replaced by n consecutive copies of that character (with the same case as in the original). For example,
Computers and Technology
1 answer:
laila [671]3 years ago
8 0

Answer:

The code of the above program is provided below. using Python

Explanation:

<u>Code in Python 3:- </u>

def modifyString(origString,charsToReplace,count):

# Make s1 as original string

s1=origString

# Make s2 as charsToReplace string in lowercase

s2=charsToReplace.lower()

# Make s3 as charsToReplace string in uppercase

s3=s2.upper()

# Initialize answer as an empty string

ans=''

# Iterate the string upto length times

for i in range(len(s1)):

# check for chars in the string and append to the answer

if (s1[i] in s2) or (s1[i] in s3):

ans=ans+count*s1[i]

else:

ans=ans+s1[i]

# return the final string

return ans

print(modifyString("Our cat is funny","aeiou",5))    

print(modifyString("Our cat is funny","zu",3))

You might be interested in
The MIQ inventory measures how much you value status. What are measures of status?
Alina [70]
When we're taking about measures of status, we're talking about either a socioeconomic perspective or something else. When we're talking about a socioeconomic perspective of status, there are two important measures. One would be social standing of a person and the other would be his economic standing. 
3 0
4 years ago
HELP ASAP, AND YES I KNOW, WRONG CATEGORY. SORRY!
Anastasy [175]

Answer:

A. ensemble.

Explanation:

A musical ensemble can be defined as a group of people who play instrumental and vocal music. It is also known as a music group and carries a distinct name. The word ensemble is derived from the Middle French ensemblée, meaning together at the same time.

A rock band will come under the category of a musical ensemble as it is also a group of people performing instrumental music or vocal music.

Therefore, option A is correct.

3 0
3 years ago
In the relocatable dynamic partitions scheme, the Memory Manager relocates programs to gather together all of the empty blocks a
kodGreya [7K]

Answer:

True

Explanation:

In computer, Memory management is a form of resource management, its essential requirement is to provide ways to dynamically allocate portions of memory to programs at their request, and to free it to be used again when not needed. Memory management is critical to any advanced computer system that uses more than a single process.

Several methods that has increased effectiveness of memory management like the Virtual memory systems which separates the memory addresses used by a process from actual physical addresses, thus allowing the separation of processes and increasing the size of the virtual address space beyond the available amount of Random Access Memory (RAM) using paging or swapping to secondary storage have been used.

"The Memory Manager relocates programs to gather together all of the empty blocks and compact them to make one block of memory large enough to accommodate some or all of the jobs waiting to get in from your question.

6 0
3 years ago
Which is an example of an input device?
kondor19780726 [428]

Answer:

b, a keyboard. Sometimes a, if it contains a microphone.

8 0
3 years ago
Read 2 more answers
_____ allows a function or operator to perform different tasks depending on the types of the arguments or operands. Group of ans
xenn [34]

Polymorphism allows a function or operator to perform different tasks depending on the types of the arguments or operands.

<h3>What does polymorphism helps?</h3>

Polymorphism is known to be that which helps its users to be able to carry out one action in a lot of ways that is many forms.

Note that Polymorphism allows a function or operator to perform different tasks depending on the types of the arguments or operands and thus makes one to work faster.

Learn more about Polymorphism from

brainly.com/question/20317264

#SJ1

5 0
2 years ago
Other questions:
  • I'm curious why I would need to know this on a school learning site.
    12·1 answer
  • 2. Which of the following fonts is most legible for a block of text? What font size and color would you choose if you were writi
    11·2 answers
  • Good afternoon guys !!!
    14·2 answers
  • how does modern information technology has affected society ?? Need help on how it has affected society
    10·1 answer
  • It is possible to collaborate on a presentation with a group of people using the Internet.
    14·1 answer
  • In C++ :
    6·1 answer
  • it has been said that television has little real educational value. what is your opinion on this issue?
    11·1 answer
  • Write any two web browers​
    10·1 answer
  • 1. Wash all work surfaces with a_______ wrung in hot soapy water.
    9·1 answer
  • What features should you present when demonstrating 2023 murano’s confident cornering?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!