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
Steps for turning off two step verification on ,for example, iPhones.
Tems11 [23]

Answer:

Step 1: Visit iCloud.com and log in with your Apple ID and password

At the same time, a window also pops up on iDevice

you need to click "Allow"

Copy the code from your phone to icloud.com

Step 2: Once signed in, select Settings on homepage

Step 3: Click "Manage" Apple ID.

Step 4: You will be directed to another site – appleid.apple.com

input your password to log in and verify it with Apple ID verification code.

Step 5: Then you will enter the manage page.

Click "Edit" in Security column.

Step 6: Click "Turn Off Two-Factor Authentication"

then confirm it.

Step 7: Then you need to select your security questions and answer them

click "Continue" after confirming your birthday and rescue email.

After all of these steps, you have turned off two factor authentication for Apple ID successfully.

Source : https://www.imobie.com/guide/anytrans/how-to-turn-off-two-step-verification-in-icloud.htm

8 0
3 years ago
This function receives first_name and last_name, then prints a formatted string of "Name: last_name, first_name" if both names a
pishuonlain [190]

Answer:

Following are the program in the C++ Programming Language.

//set header file

#include <iostream>

//set namespace

using namespace std;

//define class

class format

{

//set access modifier

public:

//set string type variable

 string res;

//define function

 void names(string first_name, string last_name)

 {  

//set if-else if condition to check following conditions

   if(first_name.length()>0 && last_name.length()>0)

   {

     res="Name: "+last_name+", "+first_name;

   }

   else if(first_name.length()>0 and last_name.length()==0)

   {

     res="Name: "+first_name;

   }

   else if(first_name.length()==0 and last_name.length()==0)

   {

     res="";

   }

 }

//define function to print result

 void out(){

   cout<<res<<endl;

 }

};

//define main method

int main() {

//set objects of the class

 format ob,ob1,ob2;

//call functions through 1st object

 ob.names("John","Morris");

 ob.out();

//call functions through 2nd object

 ob1.names("Jhon","");

 ob1.out();

//call functions through 3rd object

 ob2.names("", "");

 ob2.out();

}

<u>Output</u>:

Name: Morris, John

Name: Jhon

Explanation:

<u>Following are the description of the program</u>:

  • Define class "format" and inside the class we define two void data type function.
  1. Define void data type function "names()" and pass two string data type arguments in its parameter "first_name" and "last_name" then, set the if-else conditional statement to check that if the variable 'first_name' is greater than 0 and 'last_name' is also greater than 0 then, the string "Name" and the following variables added to the variable "res". Then, set else if to check that if the variable 'first_name' is greater than 0 and 'last_name' is equal to 0 then, the string "Name" and the following variable "first_name" added to the variable "res".
  2. Define void data type function "out()" to print the results of the variable "res".
  • Finally, we define main method to pass values and call that functions.
3 0
3 years ago
A notebook computer usually is more expensive than a desktop computer with the same capabilities because it ____.
KonstantinChe [14]
Because it is more portable.
6 0
3 years ago
A type of employment test that is used to determine if personal and behavior preferences match the position.
aleksandrvk [35]

Explanation:

correct answer is D

Background check

8 0
2 years ago
A(n) ____________ is a private data network that creates secure connections over regular internet lines.
Setler79 [48]
VPN is the correct answer
5 0
3 years ago
Other questions:
  • Which rock band apologized for automatically adding its new album to every iPhone 6 in 2014
    8·2 answers
  • Which element of the security policy framework requires approval from upper management and applies to the entire organization?A.
    5·1 answer
  • What is the recommended size for bulleted text?
    5·2 answers
  • What does an approved project summary document indicate?
    13·1 answer
  • Excel solver does not allow for the inclusion of greater than or equal to
    9·1 answer
  • Match the careers with the education required for each job
    5·1 answer
  • The Harrison Group Life Insurance company computes annual policy premiums based on the age the customer turns in the current cal
    5·1 answer
  • Which is an example of artificial intelligence in computers? A. multimedia software B. encryption software C. voice recognition
    6·1 answer
  • Write a program to enter RADIUS of a CIRCLE and PRINT AREA of TRIANGLE using Q Basic. (class 8)​
    9·1 answer
  • What is functionality criteria or alternative word
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!