Skip to content
Sign upLog in
← Back to Community

Printing/Commenting: Python Course #1

Profile icon
SyrupPY

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!

Voters
Profile icon
OlauPla
Profile icon
SyrupPY
Comments
hotnewtop
Profile icon
RayhanADev

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

Profile icon
SyrupPY

@RayhanADev
Thanks!

Profile icon
RayhanADev

@SyrupPY
no problem!

Profile icon
MDMIZANORROHOMA

print(foysal)

Profile icon
GABELACANLALE

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

Profile icon
OldWizard209

Firstly, you have markdown errors:

##Printing

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

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

Profile icon
[deleted]

@OldWizard209
yes