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
Ede4ka [16]
4 years ago
6

"Write a function named remove_all that accepts" a string and a character as parameters, and removes all occurrences of the char

acter. For example, the call of remove_all("Summer is here!", 'e') should return "Summr is hr!". Do not use the string replace function in your solution.
Computers and Technology
1 answer:
neonofarm [45]4 years ago
7 0

Answer:

def remove_all(text, char):

   return ''.join(x for x in text if x not in char )

           

print(remove_all("Summer is here!", 'e'))

Explanation:

- join() method in Python takes all the element in the string and joins them. However, inside the <em>join</em> method, we <u>excluded</u> the elements that equals to <em>char</em> in the <em>text</em>

You might be interested in
5) [4 points] Suppose you have a simple computer that is capable of storing only the months of the year. The number of bits avai
TEA [102]

Answer:

<h3>A minimum of 4 bits will be needed.</h3><h3 />

Explanation:

As there are 12 months in a year so will need 12 need combinations.

Number of bits can be determined by the powers of 2. By this we mean:

  • <u>If 1 bit is used</u>

                  2^1 = 2   Two unique combinations can be made that are                  0 and 1.

  • <u>If 2 bits are used</u>

                 2^2 = 4   4 unique combinations can be made.

  • <u>If 3 bits are used</u>

                2^3 = 8   8 unique combinations can be made.

  • <u>If 4 bits are used</u>

               2^4 = 16 16 unique combinations can be made.

               

Now we will have to use 4 bits so that 12 unique combinations may be assigned to each month.

<h3>Following is given the bit pattern for each month:</h3><h3 />

JANUARY   => 0000

FEBRUARY  => 0001

MARCH        => 0010

APRIL           => 0011

MAY             => 0100

JUNE            => 0101

JULY             => 0111

AUGUST       => 0110

SEPTEMBER => 1000

OCTOBER    => 1001

NOVEMBER => 1010

DECEMBER  => 1011

<h3>i HOPE IT WILL HELP YOU!</h3>
7 0
4 years ago
A program similar to mtr, ____, is available as a command-line utility in Windows operating systems.
KATRIN_1 [288]

Answer:

pathping

Explanation:

3 0
3 years ago
When you are writing, which of the following can you do to help your
natka813 [3]

Answer:

use transition words

Explanation:

that's the best answer of all the choices

5 0
2 years ago
Compare a Wi-Fi hotspot with a cybercafé.
erik [133]

Answer:

A WiFi Hotspot is a wireless internet connection that allows a computer, smartphone, or any other internet-enabled devices to connect to internet access points.

A cybercafe refers to any business place that allows people to access the internet usually within its premises after paying for connection access to connect to it.

Explanation:

3 0
3 years ago
What is the f(n) runtime of the following pseudocode: sum-0 for A = N/2 downto 1 for B-1 t increment sum by B Explain: exactly w
Romashka [77]

The diagram part of the question is incomplete but the mathematical part has been solved below for you . However when the diagram will be attached it will be answered too.

Answer:

Following is the solution for the Time complexity/ Run Time:

Given that:

A = N/2 to 1

B = 1 to 4N

By summation:

Time Complexity = Lower bound of A * Upper Bound of B

Time Complexity = (N/2) * (4N)

By simplifying:

Time Complexity = N * 2N

Time Complexity = 2N^2

Hence the runtime f(n) for given pseudocode will be 2N^2

i hope it will help you!

3 0
3 years ago
Other questions:
  • What is a Software Quality Assurance Audit?
    12·1 answer
  • The first step in the five-step process for problem solving is to ____. take action complete the task understand the task or nee
    10·2 answers
  • Why do hard drives tend to slow down over time?
    11·2 answers
  • Write a function called line_numberthat takes as parameters two strings representing file names. Assume these are text files. Th
    15·1 answer
  • Some have argued that Unix/Linux systems reuse a small number of security features in many contexts across the system, while Win
    12·1 answer
  • Every modern nation has a Central Bank. Which of the following is the Central Bank for these United States?
    14·2 answers
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • ¿Que similitudes y que diferencias tenían el estado y la iglesia en el proceso de colonizacion de america?​
    6·1 answer
  • Were so deleted files go
    15·1 answer
  • 1.1 give five (5) reasons why modeling is an important part of system analysis and design
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!