![subject](/tpl/images/cats/informatica.png)
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.
![ansver](/tpl/images/cats/User.png)
Answers: 1
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 08:40
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 01:30
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 02:00
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
You know the right answer?
Write a recursive function named is_subsequence that takes two string parameters and returns True if...
Questions
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
English, 21.09.2019 05:30
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 21.09.2019 05:30
![question](/tpl/images/cats/health.png)
Health, 21.09.2019 05:30
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 21.09.2019 05:30