Ask Question
23 September, 03:32

g Write a recursive function all capital (L, start, stop) that takes a string L and two integers. It returns a Boolean (True/False). The function will return True if there are ONLY upper case letters in the string from index start to index stop. The function will return False if there are any lower case letters in the string from index start to index stop.

+1
Answers (1)
  1. 23 September, 05:34
    0
    def recursive (L, start, stop):

    y = L[start:stop]

    print (y. isupper ())

    recursive ("ALLow", 0, 3)

    Explanation:

    The code is written in python.

    def recursive (L, start, stop):

    The function is defined known as recursive. The function takes a string and 2 integers known as start and stop. The parameter L is a string and the other 2 parameter start and stop are integers which indicates the index range of the string L.

    y = L[start:stop]

    A variable y is declared to store the string L with the index range from start to stop. Note start and stop are integers.

    print (y. isupper ())

    The code prints True if the index range of the string L are all upper case else it print False.

    recursive ("ALLow", 0, 3)

    This code calls the function with the required parameters L (string), Start (integer) and stop (integer)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “g Write a recursive function all capital (L, start, stop) that takes a string L and two integers. It returns a Boolean (True/False). The ...” 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