Writing our first program
It’s time to actually start coding. Traditionally, programmers start with a “Hello world!” program in whatever new language or framework they start using. But since I’m a cat, let’s make it more relevant. Python only needs one line of code for the first program, and that makes it one of the shortest first programs you can write. If you ever try a language such as C++, Java, or C#, you’ll really appreciate how straightforward Python is. Let’s see the steps for creating our first little program.
First, we need to create a new file. You know how Word documents have the .docx extension, text files have a .txt extension, and ZIP files have a .zip extension. A Python file has its own special extension as well, the .py extension. Let’s create a file and call it hello.py.
How do we create a file with this extension, you might wonder? Well, there are multiple options again. I’ll walk through one...