Ask Question
25 March, 02:07

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. 25 March, 05:59
    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?
Find 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 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