[amp_mcq option1=”head function work on string” option2=”tail function work on string” option3=”head function work on string but tail function do not” option4=”none of the mentioned” correct=”option3″]
The correct answer is: C. head function work on string but tail function do not
The head function returns the first element of a list, while the tail function returns the rest of the list. In the case of a string, the head function would return the first character, while the tail function would return the rest of the string.
For example, if we have the string “hello”, the head function would return “h”, and the tail function would return “ello”.
Here is a Python example:
“`python
head(“hello”)
‘h’
tail(“hello”)
‘ello’
“`