Ask Question
6 November, 16:42

Assuming that the message variable contains the string "Happy holidays", the statement message. find ("days"); returns a. - 1b. 10c. 11d. day

+4
Answers (1)
  1. 6 November, 18:42
    0
    Answer is b. 10

    Explanation:

    The find () method is used to search the string for a specified value and searches the first occurrence of that value. It returns the position of that specified value. If the value is not found, this method returns - 1.

    Lets say we have a message variable that contains the string Happy holidays.

    message = "Happy holidays"

    We use the method find () to find days word from the Happy holidays string in the message variable.

    The find () method will find the position of day.

    If we look at the string Happy holidays we see that the word day is at the 10th position of the string.

    H 1

    a 2

    p 3

    p 4

    y 5

    h 6

    o 7

    l 8

    i 9

    d 10

    a 11

    y 12

    s 13

    So it is at 10th position so the statement

    message. find ("days")

    returns 10
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assuming that the message variable contains the string "Happy holidays", the statement message. find ("days"); returns a. - 1b. 10c. 11d. ...” 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