How to change this for loop into a while loop? ``` def find(txt,sub): final_ans = () for
Fantastic news! We've Found the answer you've been seeking!
Question:
How to change this for loop into a while loop?
```
def find(txt,sub): final_ans = ()
for i in range(len(txt)):
if txt[i:].startswith(sub): final_ans.append(i) return final_ans
```
Related Book For
Computer Systems A Programmers Perspective
ISBN: 9781292101767
3rd Global Edition
Authors: Randal E. Bryant, David R. O'Hallaron
Posted Date: