Python Basic Syntax

Python Basic Syntax

Syntax:

print(“Hello World!”)

Output:
v

print() function:

The print() function in Python is used to output text or variables to the console. It automatically adds a newline at the end of the output, making it ideal for displaying messages or results.
In this case, we are using print() to output the string “Hello World!”.

quotes (” “) / (‘ ‘) :
The text inside the parentheses is enclosed in double quotes (” “) to represent a string. You can also use single quotes (‘ ‘) to define strings in Python. Both are valid.

Note: In programming language like C#It takes almost 6-7 lines to execute the same code you can see in the image below. In Python, the same code can be done in 1 line only
i.e. print(“Hello World”)

print()-function

Course Video

YouTube Reference :