Ask Question
21 September, 09:29

Refer to Code Example 10-1. If the user enters two extra spaces at the end of a phone number, what will happen? a. Whitespace at the end of the input is always ignored. b. The length of the number will be greater than 10 so the else clause will execute. c. The strip () method on line 1 will strip away the extra whitespace. d. The else clause will be executed.

+1
Answers (1)
  1. 21 September, 12:05
    0
    The correct option is B: The strip () method on line 1 will strip away the extra whitespace.

    Explanation:

    If a user enters two extra spaces at the end of a phone number, the code at line 1 will strip away the extra whitespace.

    phone_number = input ("Enter phone number: "). strip ()

    The strip () method is a built-in string method of Python that return a copy of the string with the leading and trailing characters removed.

    In this case; it removed the two extra spaces entered by the user.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Refer to Code Example 10-1. If the user enters two extra spaces at the end of a phone number, what will happen? a. Whitespace at the end of ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers