课程: Hands-On Advanced Python: Data Engineering Basics
CoderPad challenges
- [Instructor] This course includes automated code challenges that appear when you click on the challenge links in the course's table of contents. Each challenge includes instructions, and a couple of code editors you can use to create and test your own solution to the challenge. These challenges are hosted by CoderPad, and they appear in the same area of the course page where you watch the course's videos. We recommend using a desktop browser for the best experience with the code challenges, but you can use the LinkedIn Learning mobile app if you prefer. The code challenge has four areas. There's the instructions in the top left, a code editor for your answer in the top right, another code editor where you can see how your code is used here in the bottom right, and there's a console for output in the bottom left. You can use these drag handles to allocate space as you like, and you can see I can bring up the console a little bit here. And you can also collapse the course's table of contents on the left to get more space. Each challenge has instructions that include a description of the challenge, and the challenge's parameters, and the desired result. Depending on the challenge, you might see some additional information in the instructions, such as an explanation of the parameters that your code will be given, along with some examples of what the expected output might look like. So you're going to create your answer in the top right code editor, and there are comments showing where to put your solution. When you click the test my code button, you'll see a message indicating whether your code returned a correct result. So let's go ahead and put in the right result. So to find the largest number, I'm going to return max, and I'm going to call numbers. All right, and then I'll click test my code. And you can see down here in the console, that I have a successful result, and it shows what my code returned. So if your code isn't successful, let's go ahead and put this back just returning zero, and I'll click test my code again. You can see that now I have the wrong answer, and I can ask for help. So the show expected results and show hints variables up here determine whether you see the expected result and any hints. You can change them each to a value of true to control this output. So let me go ahead and change those, and I'll show you what I mean. All right, and so now I'll click test my code again, and you can see that it says, all right, it's incorrect. Here's what my code returned, and if I scroll down, you'll see that now, it shows what the expected result is, and it's giving me a hint. The code editor in the lower right shows how your code will be executed, and you can change this code to experiment with different test cases. So instead of the large number being 19, I'll make that 25, and let's go back and put the right answer in again. I'll click test my code, and sure enough, now you can see I'm getting the new correct answer. Regardless of whether your answer is successful, you'll see messages in the console output, here in the lower left. And if any messages are too long to fit in that area, you can scroll sideways to see all the text, or again, use the drag handles to resize the area to your preference. When you've finished each code challenge, return to the course's table of contents, and click the next video to see my solution.