Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Solve the First Puzzle

00:00 Now we have checked our example. We could also check further examples. Yeah, maybe you can pick one of them and try it out. Yeah, so let’s check this one.

00:11 For instance, it says that the answer should be 10.

00:17 So then I’ll just go in here. I’ll

00:21 store it like this, and let’s comment out the previous one.

00:26 For this example, we should get the answer 10, which seems to leave us there I think. So we should get rfnt and 10, which we can see here.

00:39 So that also seems to work well with the code. Okay, so it seems like the code is ready for the big input.

00:48 That’s right. I’ll click get your puzzle input. And this particular link will only be available if we have logged in, like I’ve done. So if you don’t see this, it just means that you haven’t logged in yet.

01:01 So you need to log in. Then this is now a very long string, but I’ll just copy it and then move it over to my editor, and then I’ll type it in here inside of the quotes,

01:20 and then we can try to run it again. So I’ll save and run the code, and here it says that it found a marker fmwg at position 1538.

01:36 Okay, just like to clarify, like, at position 1,538, so it’s a way more long string than before. Yes, exactly. And I guess we could even here search in our string fmwg, and we can see that indeed there is a marker far out here that says fmwg.

02:00 So it seems like it’s, we’re at least not inventing characters. Yeah, and there is an interesting part here as well because if you just see the short example strings, you could say, like, why do I need a program for this? I can just look at the string and solve it myself. But now we have a string that’s way longer.

02:20 So that’s why it’s worth learning Python or any other programming language to let Python do the work here. Exactly. Yeah. No, I think for this one, it’s, I guess, still humanly possible to find this marker, but it’s not a very fun task.

02:35 It’s more fun to actually code it up.

Become a Member to join the conversation.