Learn to Code via Tutorials on Repl.it!

← Back to all posts
Printing/Commenting: Python Course #1
SyrupPY (5)

Printing/Commenting: Python Course 1

Printing

Have you ever wanted to to learn Python? Well, here is a course you can take to learn or enhance your coding skills.
Printing is a very simple concept. You print by using the statement:

print()

But of course you'll want to write inside the statement.
But before you write, you have to add either a double quote or a single quote after and before what you want to say.
NOTE: You cannot do double quote and single quote, or single quote and double quote.
Example:

print("Hello!")
print('Hello!')

You can also print True, False and numbers.

Commenting:

Commenting is fairly easy, just add a # (hashtag) before what you want to say.
Example:

# This is a comment

Multiline commenting is a bit harder. You have to add either three double quotes or three single quotes. before and after what you want to say:

""" This is a multiline comment.
I told you this is a multiline comment!
"""
or 
''' This is also a multiline comment.
with single quotes.
'''

Syntax for printing:

For ' you want to print(" \' ")
For " you want to print(' \" ')

Tricks I use:
# 1
for a new line, I do:
print("\n Hello!")
which prints a new line:

Hello!

# 2
For a tab, I do:
print(" \t Hello!"):

    Hello!

I advise you to not just read this tutorial, I advise you to practice.
That's all for today!

Comments
hotnewtop
RayhanADev (2621)

Hey, I edited your post to improve the formatting a bit. Good luck!

GABELACANLALE (33)

The text is hard to read without formatting your code, and what your saying in the tutorial just feels weird to read.

OldWizard209 (1638)

Firstly, you have markdown errors:

##Printing

You have to put a space after the hashtag: ## Printing

Format your code using a pair of backticks: (`)