Ask Question
12 December, 12:36

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.

+2
Answers (1)
  1. 12 December, 13:42
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers