Introduction to Python
Table of Contents
Python is a general-purpose, object-oriented and high-level programming language. What this means is that it can and is used in a wide variety of different applications, you can structure your code with objects which helps maintain readability, and because it is a high-level language, it abstracts away a lot of the details we don't need to worry about.
Because of this, Python allows the programmer to focus on writing code and it can handle the rest.
Prerequisites
- A computer that can install and run Python.
- A desire to learn how to code!
With that being said, let's get started!
Installing Python
If you already have Python installed, you can skip this section. Otherwise, install the latest version of Python 3.
Head over to the downloads page to get your copy.
Python downloads page
Once installed, open your Python shell. It should look something like this:
Python shell
Alternatively, you can type:
BASHpython -V
To confirm your Python version and it should look something like this:
BASHpython -V
Python 3.8.0
Hello World
Create a brand new file titled hello-world.py
. Inside the file, put this code in:
PYTHONprint("Hello world!")
If you're using Python Shell, open the file, then simply hit "Run Module" under "Run".
You should see this:
BASH>>>
================= RESTART: hello-world.py ================
Hello world!
>>>
If you see the words printed, you have everything you need to begin this class on Python!
Let's get started with Python!
Resources
- How to Install Node on Windows, macOS and Linux
- Managing PHP Dependencies with Composer
- Getting Started with Svelte
- How to Serve Static Files with Nginx and Docker
- How to Set Up Cron Jobs in Linux
- Best Visual Studio Code Extensions for 2022
- How to build a Discord bot using TypeScript
- How to deploy a PHP app using Docker
- Getting Started with Sass
- Getting User Location using JavaScript's Geolocation API
- Getting Started with Moment.js
- Building a Real-Time Note-Taking App with Vue and Firebase