Syntax of Python

What is Syntax ?

Computers are machines that can interpret your instructions only if you type them in the exact format that the computer expects. This expected format - the spelling, formatting and grammar - is called the 'Syntax'.

For example :

#This function divides two numbers

def divide(x,y):                                                           
return x/y                                                                   
                                                                                   
print("Select Operation : ")                                             
print("1. Add")                                                          
print("2. Subtract")
print("3. Multiply")
print("4. Divide")

This is the syntax.


We will look at how the basic syntax of Python works in the next posts.

Comments

Popular posts from this blog

Simple Hello World Program Tutorial