Computers and Technology, 27.07.2021 19:50 kadenbaker4788
Write a recursive function named is_subsequence that takes two string parameters and returns True if the first string is a subsequence of the second string, but returns False otherwise. We say that string A is a subsequence of string B if you can derive A by deleting zero or more letters from B without changing the order of the remaining letters. You can assume that neither string contains upper-case letters.
You may use default arguments and/or helper functions.
Your recursive function must not: use imports. use any loops use any variables declared outside of the function. use any mutable default arguments.
What I have so far (must use this format):
def is_subsequence(strA, strB = None):
if strB == None:
strB = []
print(is_subsequence("dog", "dodger"))
My problem:
I can't figure out how to recursively edit the string the way the assignment says by removing letters. (strB. replace("e","") doesn't work) or how to do this without passing an index.
Answers: 1
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
Computers and Technology, 23.06.2019 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
Write a recursive function named is_subsequence that takes two string parameters and returns True if...
Mathematics, 06.04.2020 20:23
Mathematics, 06.04.2020 20:23
Mathematics, 06.04.2020 20:23
English, 06.04.2020 20:23
History, 06.04.2020 20:23
English, 06.04.2020 20:23
Mathematics, 06.04.2020 20:23
Chemistry, 06.04.2020 20:23
Chemistry, 06.04.2020 20:23
Mathematics, 06.04.2020 20:23