( Hello World !) Program and Comments in Python

Today we are going to write our first program in python. So let’s start. Open your code editor and start writing with me .

print("Hello World ! This is your first python program.")
Python

Output : –

Hello World ! This is your first python program.
Markup

Congratulations you write your first python program.

Let’s understand how its work. Print is a built in function when we want to display ouput on screen we use print function any thing inside the print its print on the output screen.

What is Comments in python ?

Any line of code that we dont want to execute with program and compiler ignore those lines are called comments.

Example:-

# This is a comment 
print(" We use hash (#) to comment. ")
Python

There are two types of comments

  1. Single line comments : – Using # in above example
  2. Multi line comment : – When we want to comment more than one line then we use multi line comment using (”’ ”’) triple quote symbol.

Example : –

# this is a single line comment

print("Hello world")

''' this 

        is 

          multi line comment '''
Python

I hope you learn and enjoy how to write program in python . If you have any query or suggestion please do a comment.

Thank You !

Comments

Popular posts from this blog

⚠️How to create a virus in termux app ?

List in Python

How To Install Metasploit In Termux App ?