Ask 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 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.

+4
Answers (1)
  1. 16 August, 20: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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers