Python Syntax | How To Execute Python Syntax | TECH WORTH MIND

 Here we will learn Python syntax, the syntax of Python is very simple and easy to understand.

How to execute Python syntax?

Just write directly in the comment line and execute the Python syntax.


Python Indentation/whitespace

Indentation means the space at the beginning of a code line.

In other programming languages, we use a semicolon and curly bracket but in Python, we use space to indicate the block of code.

Indentation play important role in Python programming in readability as well as to define the scoop.


Example:- if 5>2:

                    print("Five is greater than two!")


Python displays an error if you miss the indentation.

The number of spaces depends upon you, but it has to be at least one.

Python Variables

Variable in Python is created by assign a value to it.
Example:-
          X=5
          Y="Hello, Reader"

Note- In Python for declaring a variable there is no command.

Python Comments

In Python, comments start with # and the rest of the line render as a comment.
Example:- #This is a comment

Multi-line Comments


Python has no syntax for the multi-line comment you need to add # before every comment line.




                                         Next

Comments

Popular posts from this blog

How To Hack Wifi | Hack Wifi Password | TECH WORTH MIND

Remove Tools From Termux | How can I reopen the installed tool in termux? | TECH WORTHY MIND