Python Syntax
Python Tutorial » Python Syntax
Python syntax can be executed by writing directly in the Command Line:
Welcome to your first page Python tutorial!:
>>> print("Hello my Python tutorial!")
Hello my Python tutorial!
Hello my Python tutorial!
Or creating a python file on the server, as .py extension file, and running it in the Command Line:
Welcome to your first page Python tutorial!:
E:\Users\Your_Directory_Name\python_myfile.py
Python Indentation - examples
Indentation refers to the spaces at the beginning of a code line.
Python uses indentation to indicate a block of code.
Example:
Nine is greater than seven!
if 9 > 7:
print("Nine is greater than seven!")
Output:print("Nine is greater than seven!")
Nine is greater than seven!
Python will give you an error if you skip the indentation:
Example: Syntax Error:
ERROR
if 9 > 7:
print("Nine is greater than seven!")
Output:print("Nine is greater than seven!")
ERROR
The number of spaces is up to you as a programmer, but it has to be at least one.
Example:
Nine is greater than seven!
Nine is greater than seven!
if 9 > 7:
print("Nine is greater than seven!")
if 9 > 7:
print("Nine is greater than seven!")
Output:print("Nine is greater than seven!")
if 9 > 7:
print("Nine is greater than seven!")
Nine is greater than seven!
Nine is greater than seven!
You have to use the same number of spaces in the same block of code, otherwise Python will give you an error:
Example: Syntax Error:
ERROR
if 9 > 7:
print("Nine is greater than seven!")
print("Nine is greater than seven!")
Output:print("Nine is greater than seven!")
print("Nine is greater than seven!")
ERROR
pithon free online tutorial
Python Syntax - python
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.