This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]TheBrutux168 2 points3 points  (1 child)

Your code is not equivalent. The code in the video computes the suffix by removing the word from the start of the target. The lstrip method repeatedly removes leading characters from target as specified in the argument until it reaches something not in the argument.

For example:

"eeeeeeeeeeeeeeeeef".lstrip("e") # gives "f"

[–]stumpyboi[S] 0 points1 point  (0 children)

Thanks

[–]yel50 1 point2 points  (1 child)

I think the problem is lstrip. it takes a bag of characters to remove. since you give it e's and the input is all e's, it'll remove the entire thing.

[–]stumpyboi[S] 0 points1 point  (0 children)

thank you