Python Syntax

Python programming has simple and flexible syntax. It has most common rules with other famous programming languages such as C, C++ and Java. Python is not a strongly typed programming language. It means that there is no need to assign data types for the variables before assigning value. The type of variable will depends on the contents/data.

Python Indentation Syntax

Such like other programming language python does not use delimiters/parenthesis for defining code or control structure boundries. This feature also provide better code readability. Indentation has a vital role in python programming. Indentation is also used in code nesting.

Python Lvalue and Rvalue

In python programming Lvalue is the name of identifier that can be further acces in entire code/program and Rvalue is the data that is store in variable/identifier. The type of Lvalue depends on the type of Rvalue. After assignment of data to particular variable we can check it's type by using type function.

Check type of variable in python

Type function will return the type class of particular variable.

x = 10
print(type(x))
y = "Hello World"
print(type(y))

The output of following code will be as:

<class 'int'>
<class 'str'>

Python File Extension

Python script can directly excute using terminal which is called python interpretor. We can also store the entire script in a file, the file file extension for python source code is .py.

 
 
 

 

 
Comments
Login to TRACK of Comments.