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
Radda [10]
3 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]3 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
A feature that displays in the lower right corner of a selected range with which you can analyze your data by using Excel tools
bagirrra123 [75]

Answer:

Quick analysis tool.

Explanation:

Excel is a spreadsheet application package found in the Microsoft office suite. it's environment on the display screen is called a worksheet and a collection of the worksheets is called a workbook. The excel packet is used for data analysis and interpretation and presentation.

When a group of cells in a worksheet is selected, a small tool kit appears that the lower right corner, it is known as a quick analysis tool. It is use for easy and fast analysis and formatting of that selected group.

5 0
3 years ago
Read 2 more answers
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?
nataly862011 [7]
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?

development

5 0
2 years ago
PLEASE HELP ME !!! THIS IS DUE TODAY AND IM STUCK ON IT!!! Pls❤️✨❤️
Georgia [21]
What do you need help with?
4 0
3 years ago
When would you include an executive summary in a report
Hoochie [10]

Answer:

When the report is too long and complex. The executive summary provides a snapshot of what the report talks about at a high level. When the reader needs more details, they can go through the detailed report.

Explanation:

7 0
3 years ago
Read 2 more answers
You are given an unsorted array x of elements that implement the Comparable interface. There are no duplicates in this array. Yo
Andrei [34K]

Answer:

boolean isEven = false;

if (x.length % 2 == 0)

isEven = true;

Comparable currentMax;

int currentMaxIndex;

for (int i = x.length - 1; i >= 1; i--)

{

currentMax = x[i];

currentMaxIndex = i;

for (int j = i - 1; j >= 0; j--)

{

if (((Comparable)currentMax).compareTo(x[j]) < 0)

{

currentMax = x[j];

currentMaxIndex = j;

}

}

x[currentMaxIndex] = x[i];

x[i] = currentMax;

}

Comparable a = null;

Comparable b = null;

if (isEven == true)

{

a = x[x.length/2];

b = x[(x.length/2) - 1];

if ((a).compareTo(b) > 0)

m = a;

else

m = b;

}

else

m = x[x.length/2];

8 0
3 years ago
Other questions:
  • A DFA is equivalent in power to an NFA. True False
    7·1 answer
  • What are a few benefits of virtualization?<br> How do they benefit ?
    9·1 answer
  • Special programs that facilitate communication between a device and the os are called
    12·1 answer
  • Write a program to calculate and return total surface area of a box using FUNCTION _END FUNCTION.​
    15·1 answer
  • Which online resource is usually not free?
    10·2 answers
  • If a client is found _________ the NAP will attempt to make it _______. Group of answer choices A. non-compliant, compliant B. s
    13·2 answers
  • In order for the image tag in an HTML file to function properly, the file named square.png must be located where?
    5·2 answers
  • Calculate the number of telephone
    5·1 answer
  • What are some things that games were historically used for?
    7·1 answer
  • What can handle work that is hard on a person and could cause repetitive injuries?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!