Refactor to Use a Function
00:00 At the top here, we just recorded the stream of characters where we have used a couple of the examples from the web page, and then we have our own input that we have recorded here.
00:11
And then we start with the actual problem solution. And let’s just call this find_marker()
or something like this. And I’ll define this as a function.
00:23
And what I need here is that I need to have the text stream that we’re searching for and we want to have the marker_length
as a parameter that we can change.
00:33 So if I’m doing this, I can remove the hard-coded marker length there.
00:39 This is now a function, so I’m indenting all the code. And then let’s have a look at what we are doing.
Become a Member to join the conversation.