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
What type of information is appropriate for headers and footers? Check all that apply.
lbvjy [14]

Answer:

slide/page number

smart art

maybe date and time

Explanation:

6 0
3 years ago
Read 2 more answers
By incorporating video games into classwork, teachers would help students become more confident decision makers.
dangina [55]

teachers would help students become more confident decision makers.

7 0
3 years ago
Read 2 more answers
What are all the possible 4-digit codes you can make with the numbers 7, 0, 9, and 3?
Arte-miy333 [17]
0,7,0,0
9,9,0,0
7,7,7,7
3,9,0,7

Hope this helps
4 0
3 years ago
Read 2 more answers
What permanent magnets of a motor are replaced with more powerful ones, what effect do you think this would have on motor rotati
Marat540 [252]
When permanent magnets of a motor are replaced with more powerful ones, the motor rotation will increase. This is because there is more electricity being generated.
7 0
3 years ago
Read 2 more answers
Which image file format consumes the most file<br> space?<br> 0<br> GIF<br> JPEG<br> PNG
gogolik [260]

Answer: jpeg becauuse itss correct

5 0
3 years ago
Other questions:
  • what’s The abbreviation of afk and what does That Mean in gaming playing in Multiplayer online battle arena games
    10·1 answer
  • A___________ is a person who can give information to potential employers about your character and your abilities. Employer emplo
    7·1 answer
  • What are three situations when recursion is the only option available to address problems?
    10·1 answer
  • Modify the program so that it can do any prescribed number of multiplication operations (at least up to 25 pairs). The program s
    9·1 answer
  • I NEED an example of output plssss​
    13·1 answer
  • What is the full form of USB​ ?
    15·1 answer
  • Write a function that converts a string into an int. Assume the int is between 10 and 99. Do not use the atoi() or the stoi() fu
    6·1 answer
  • Read a sentence from the console.
    6·1 answer
  • Answer this if you can help me!
    11·2 answers
  • HELP ME PASS!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!