From the course: Programming Foundations: Algorithms
What you should know - Python Tutorial
From the course: Programming Foundations: Algorithms
What you should know
- Before we get started, there are some concepts you should already be familiar with in order to get the most out of this course. First, you should already be familiar with the basic concepts of programming. This includes writing functions, declaring and using variables and other basic tasks involved with writing code. If you need to brush up on these skills, check out the Programming Foundation's Fundamentals course. I'm going to be using the Python language in this course to work through our examples. You don't need to be deeply familiar with Python in order to take this course. None of the algorithms that we're going to learn about are specific to Python, but it's a very popular language. It's easy to set up on a variety of operating systems, and it's even easier to learn. If you're already familiar with a programming in a different language, then you probably won't have any difficulties following along. But I'd recommend you check out the Learning Python course if you need to brush up on your Python knowledge, I'll switch over to the code to show you the rest of the setup. I've set up a GitHub repository with the example code, and you can find it at this link. The course content is organized into two separate folders. The finished folder contains all of the code examples in their finished state, so you can compare your code against them as you work through the course. The start folder contains the code examples in the beginning state, and this is the folder I will be working in throughout the course as we build towards the finished state for each example. If you want to download the examples and work with them locally on your computer, then that's easy enough to do. Just click on this Code menu, go to the local tab and you can either clone the repository or download a zip file and then use your favorite code editor to work on the examples. You will just need to make sure that you have Python installed on your computer, at least version 3.10 in order to use the examples. But this repository has also been set up with a GitHub Codespace, so you can just work directly online with nothing to install. All you need to do is fork a copy of the repository into your own GitHub account and then go to the code menu and go to Codespaces and fire up a Codespace and you won't need to install anything. Now you can see that I've already done that. I've already created a Codespace and this is the one I'll be using in the course. Either way, it works fine, but I'm going to be using the Codespaces feature in this course. So let me open the Codespace and show you what it looks like. When you create your own, it'll take a few moments to spin up, so just be patient. When the code space starts, you'll see a browser-based version of Visual Studio Code, and here in the files list are all the files that you'll need for the course. You'll also have a built-in terminal, which can be found in the View menu. So if I go to the View menu, you'll see it's right here, or you can show and hide the terminal by typing Control + backtick. Alright, so let's go ahead and open up the terminal and I'll make sure that Python is already installed. I'll type Python --version and sure enough I've got 3.10.12. You also want to make sure that you have the Python and Pylance extensions installed. So if I go over here to the Extensions menu, which is the little boxes, you can see that I've got a few extensions installed. Here's Pylance and Python. In fact, if you install the Python extension, it'll install Pylance for you. If these aren't already installed, just go find them in the Visual Studio Code Marketplace. One other thing to check quickly is to make sure the preferences are set correctly, so you can go into the Preferences and you can find those either here in the File menu. So it says preferences, and you go to Settings or you can just type Control + comma, and let's close the terminal for this. And once you are into the preferences, going to search for the word "execute", and let's see, execute. Let's execute in. There we go. So search for the term, "execute in", and then make sure this box here "Execute in file DIR", is checked. That's pretty much all there is to set up. So once you have the Codespace set up for your account, and you've got the preferences the way that you want them, you are ready to go.