PYTHON SYNTAX
STATEMENT:- Any set of instructions which a python engine can excute.
- single statement in sinle line.
ex:- 1+1
o/p:- 2
2. Multiple statement in single line.
s1;s2;s3;s4
ex:- print 1+1; print 2+2; print 3–3
o/p:-
2
4
0
3. sinle statement in multiple line.
ex:- 2+3–5
o/p:- 0
COMMENTS:-
A set of instructions can’t be executed by python or text ignored by the python interpreter used to explain code.
Comments are used to improve readability document code and disable code temporarily.
Get Kavyashrims’s stories in your inbox
Join Medium for free to get updates from this writer.
Types of comments:-
- single-line comment(#)
- multi-line comment
KEYWORDS:-
Keywords are reserves words in python that have special meanings.
Keywords is used to define the syntax of the coding.
The keyword cannot be used as an identifier function or variable name.
ex:- import keyword
keyword.kwlist
VARIABLES AND ITS RULES:-
VARIABLE:- It is a container to store python data is called variable. whenever we want to reuse again and again.
syntax:- variable name = data
ex:- x=10
variables rules are called naming conventions.
Naming conventions is a set of rules to create a variable name.
VARIABLE RULES:-
- Variable name should always start with an alphabet or _ underscore
- Variable name should not contain any special characters (except underscore).
- Variable name can contain numbers not on the first character.
- Python is a code sensitive language.
- Never ever use keyword as variable name.



