In the previous part of this tutorial we explained the process of installing Python on your computer. In this tutorial we will explain about the Basic Syntax of Python language.
Once Python is installed in your computer you can use one of the following tools to code and execute python.
You can search for Python in your computer programs and you will find these two options.
IDLE is an integrated development environment for Python.
Other One is the Command Prompt Windows for Python Coding.
IDLE is a preferred option for Python Coding because it has a Coding Editor with built in auto suggest tool. It has nice color coding to differentiate between various elements of a code.
Python Uses a built-in function named print to print any statement.
If we want to print “Welcome to Python Tutorial” we can use the following command.
print (“Welcome to Python Tutorial by Slidescope”)
You can see the Screen Shot of IDLE Window.
The line with three Greater Than Signs >>> is the input line
The next line in Blue is the Output.
You can see the Statement to be printed is written in Round Brackets and Double Quotes.
You can also use single quotes.
Value written inside Quotes Represent a String Data type.
To print integer or float type values we don’t have to use single or double quotes.
Syntax to Print an Integer Value:
After writing the Input we have to press enter to execute the command and present output.
Please try using these commands in your practice and let us know if you have any doubts in the comment section below.
If you are not familiar about Data Types in Programming Languages then Refer to Our Next Tutorial which explains the data types topic.
Official Website of Python Is www.Python.org