![Computers and Technology](/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.
![answer](/tpl/images/cats/otvet.png)
Answers: 1
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 00:00, Kaylaonfleek0956
Consider the series where in this problem you must attempt to use the ratio test to decide whether the series converges. compute enter the numerical value of the limit l if it converges, inf if it diverges to infinity, minf if it diverges to negative infinity, or div if it diverges but not to infinity or negative infinity.
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 15:30, lakenyagillard79
Python. primary u. s. interstate highways are numbered 1-99. odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. thus, the 405 services the 5, and the 290 services the 90. given a highway number, indicate whether it is a primary or auxiliary highway. if auxiliary, indicate what primary highway it serves. also indicate if the (primary) highway runs north/south or east/west.
Answers: 1
Do you know the correct answer?
Write a recursive function named is_subsequence that takes two string parameters and returns True if...
Questions in other subjects:
![Konu](/tpl/images/cats/himiya.png)
Chemistry, 09.04.2020 05:04
![Konu](/tpl/images/cats/en.png)
English, 09.04.2020 05:04
![Konu](/tpl/images/cats/mat.png)
Mathematics, 09.04.2020 05:04
![Konu](/tpl/images/cats/mat.png)
Mathematics, 09.04.2020 05:04
![Konu](/tpl/images/cats/mat.png)
Mathematics, 09.04.2020 05:04
![Konu](/tpl/images/cats/mat.png)
Mathematics, 09.04.2020 05:04
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/ekonomika.png)
Business, 09.04.2020 05:04
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 09.04.2020 05:04