Basic Syntax of Python

There is no use of curly braces or semicolon in Python programming language. It is English-like language. But Python uses the indentation to define a block of code. Indentation is nothing but adding white space before the statement when it is needed.

Print "Hello World" in Python:
print("Hello World")
The print() function displays the given object to the standard output screen.
Output will be
Hello World


Creating a Single Line Comment:
In python a single line comment starts with a #
#This is a comment
print("Welcome to Neoogy")

Output will be
Welcome to Neoogy


Creating Multi Line Comments:
In python multi line comment are enclosed in a delimiter (""") on each end of the comment.
"""
This is an example of
multi line comment
in python
"""
print("Welcome to Neoogy")

Output will be
Welcome to Neoogy


0 Comments