Ask Question

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

+1
Answers (1)
  1. 16 April, 13:47
    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 & 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