Learn to Code via Tutorials on Repl.it!

← Back to all posts
Python Tutorial - Installment #1

Well, I decided to make this tutorial about python.
In this tutorial I will be explaining 3 concepts: the print statement, the input statement, and variables.

First up the print statement.

The print statement is simple.
Just type print, followed by a pair of brackets. Inside the brackets you write something in quotes. That will be displayed on the screen. (You only need quotes for sentences, not numbers.

Next up, variables.
Like in math, a variable is something that is not constant. To create a variable just type the name you want to give it, followed by =, followed by a value.

Now you can print out your variable.

Variables can be changed at any time, like so.

Essentially, variables hold information. The information can be changed, and it can be displayed to the screen using print. I know it may be a bit overwhelming if you are completely new to programming, but you'll figure it out quickly enough.

Last but not least, the input statement.
Most computer programs work by taking input from a user and producing a result based on that input.
By typing input(), the user of the program will be prompted to enter some data.

(In this example, it asked for input and I wrote "pizza".)

You can assign variable to input.

In this example, we ask for a name, assign that name to a variable, and print out a message using that name.

Don't worry if you don't get it at first, coding can be confusing, just read it over and over until it makes sense.

Next tutorial: commenting, string concatenation, and if/else statements.