answer.
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
Radda [10]
2 years ago
15

The function below takes a single string parameter: sentence. Complete the function to return everything but the middle 10 chara

cters of the string. You can assume that the parameter always has at least twelve characters and is always an even number of characters long. Hint: To find the middle of the string, you can half the length of the string (floor division). Then slice out 5 less than the middle to 5 more than the middle.
Computers and Technology
1 answer:
dolphi86 [110]2 years ago
7 0

Answer:

def get_middle_ten(sentence):

   ind = (len(sentence) - 12) // 2

   return sentence[ind:ind + 12]

# Testing the function here. ignore/remove the code below if not required

print(get_middle_twelve("abcdefghijkl"))

print(get_middle_twelve("abcdefghijklmnopqr"))

print(get_middle_twelve("abcdefghijklmnopqrst"))

You might be interested in
How long does it take 2 consultants to create a slide deck of 120 slides, assuming one consultant make 2 slides per hour?
Andreyy89

It would take 2 consultants 30 hours to create a slide deck of 120 slides.

Explanation:

Rate of slide making by one consultant- 2 slides per hour

Target- 120 slides

2 consultants are employed in the job-  

Since 2 consultants are employed in the job, total rate of making slides per hour would be 4 slides/hour (2*2 slides/hour)

Time required to complete 120 slides= total slides/rate of doing slides per hour

Substituting the values, we get

Time required= 120/4= 30 hours

Hence, it would take 30 hours for 2 consultants to create a slide deck of 120 slides.

7 0
2 years ago
Developed by ibm and refined by symantec, the __________ provides a malware detection system that will automatically capture, an
Nadya [2.5K]
Digital Immune System (DIS)
6 0
2 years ago
The groups_per_user function receives a dictionary, which contains group names with the list of users. Users can belong to multi
Akimi4 [234]

The groups_per_user function receives a dictionary, which contains group names with the list of users.

Explanation:

The blanks to return a dictionary with the users as keys and a list of their groups as values is shown below :

def groups_per_user(group_dictionary):

   user_groups = {}

   # Go through group_dictionary

   for group,users in group_dictionary.items():

       # Now go through the users in the group

       for user in users:

       # Now add the group to the the list of

         # groups for this user, creating the entry

         # in the dictionary if necessary

         user_groups[user] = user_groups.get(user,[]) + [group]

   return(user_groups)

print(groups_per_user({"local": ["admin", "userA"],

       "public":  ["admin", "userB"],

       "administrator": ["admin"] }))

3 0
2 years ago
Sam’s password is known to be formed of 3 decimal digits (0-9) in a given order. Karren and Larry are attempting to determine Sa
prohojiy [21]

Answer:

100

Explanation:

7 0
2 years ago
Read 2 more answers
Why were the practitioners of alternative software development methods not satisfied with the traditional waterfall method?
horsena [70]

Answer:

- The linear and rigid nature of waterfall method of SDLC.

Explanation:

Software development life cycle or simply SDLC are stages or processes that a licenced software company must follow to design, develop, deploy and maintain a functional application.

There are two main SDLC processes, they are agile process and the traditional waterfall process. The agile process allows for sprint or parallel and repeated execution of the stages in the process, but the waterfall process allows for serial execution of stages, where one stage must end before the other begins. This makes the agile process fast and reliable.

In the agile process, software design is flexible, can be changed at any time without affecting it's operation, but in waterfall, all designs must be concluded before the next stage and cannot be changed afterwards.

6 0
2 years ago
Other questions:
  • The ____________ protocol enables two users to establish a secret key using a public-key scheme based on discrete logarithms
    10·1 answer
  • Which telecommunications device is widely used in industries that require closed communication?
    7·2 answers
  • If the computer has an encrypted drive, a ____ acquisition is done if the password or passphrase is available. a. passive b. sta
    8·1 answer
  • A hidden backlog contains the projects that the IT department is not aware of because of low feasibility.
    13·1 answer
  • Mrs. Johnson is here today to receive an intercostal nerve block to mitigate the debilitating pain of her malignancy. Her cancer
    13·1 answer
  • Write the state of the elements of each of the following arrays after each pass of the outermost loop of the selection sort algo
    11·1 answer
  • In the simulation, player 2 will always play according to the same strategy. The number of coins player 2 spends is based on wha
    6·1 answer
  • Create an abstract Division class with fields for a company's division name and account number, and an abstract display() method
    14·1 answer
  • Double any element's value that is less than controlValue. Ex: If controlValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4
    8·2 answers
  • Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!