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
What are events in computer programming?
N76 [4]

Answer:

mnkn

Explanation:

3 0
3 years ago
Read 2 more answers
In Python, if var1 = “Happy” and var2= “Birthday” and var3 = (var1+var2) *2, then var3 stores the string
-Dominant- [34]

Answer:

A

Explanation:

var3 is happy + birthday, ×2

l.e happy birthday happy birthday

3 0
3 years ago
To remove all the changes made to your system, the Windows ________ utility returns your computer to the state it was in when it
coldgirl [10]

Answer: Refresh

Explanation:Refresh is the tool available in the operating system for the regaining the page with actual factors . It eliminates the factors that made change before in the computer.

It is also done for the quick updating of the desktop so that the work done in the system in from the initial period and not containing any previous changes.It regains the utility,refreshes the function back  to active mode etc.

4 0
3 years ago
One benefit of open source software is that it
NISA [10]

Answer:B

Explanation:

8 0
3 years ago
How many words can be stored in a RAM with a 16-bit word size and a total capacity of 4096 bits; and how many address lines are
masya89 [10]

Answer:

There total capacity of RAM is 4096 bits.

Word Size = 16 bits

Total Number of words in RAM = 4096/16

Total Number of words in RAM = 256 locations

Now compute the number of addresses.

No. of addresses = log₂(256)

                             = log₁₀(256)/log₁₀(2)

No. of addresses = 8 address lines

Total 8 address lines required to address 256 locations RAM of size 16 bit each location.  

Explanation:

There we are unable to calculate log base 2. There is a formula to calculate this as

log₂(x)= log₁₀(x)/log₁₀(2)

4 0
3 years ago
Other questions:
  • Query: [mcdonalds Austin] Viewport: Fresh User Location: within Houston, TX Result Returned: McDonalds location in a neighboring
    7·1 answer
  • Which statement best describes antivirus software
    12·2 answers
  • If you're doing a relational comparison, which filter would be available?
    15·1 answer
  • Find products that satisfy BOTH conditions below:______
    6·1 answer
  • I have a very quick question. So im applying for Early college and i need some future educational goals and maybe im just thinki
    6·1 answer
  • Which one should i get?
    5·2 answers
  • What is the first step a user should take toward generating an index?
    7·1 answer
  • computer hardware without software is useless while computer software without hardware is meaningless. explain what do you under
    13·1 answer
  • Which of the following tabs on the Ribbon contains the command to add a Quick Part to a document? A Design B Insert C View D Hom
    7·1 answer
  • Choose the answer that best completes the visual analogy.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!