Python Revision Tour
Python Revision Tour
Python tour
TOKEN in PYTHON =
for a1 in range(1,10):
if a%5==0: punctuators
Keyword
print(a1) Literals
operators
identifiers
KEYWORDS.
Keyword are the predefined words with special meaning to the language compiler or interpreter.
Identifier :-
=> Identifiers are the names given to different parts of the program
Literals / Values
Literals are data items that have fixed/constant values
Operators
-- Operators are tokens that some computation / action when applied to variable and other objects in an
expression.
Operators sign
Arithmetics operators (+,-,*,/,%,**,//)
Bitwise operators (&,^,l)
shift operators (<<,>>)
operators sign
Relational <,>,>=,>=,==,!=
Assignment =
Membership in , not in
Arithmetic-assignment /=,+=,-=,*/,%=,**=,//=
Computer science
Python tour
Punctuators :-
= > Punctuators are symbols that are used in a programming language to organize sentence structures
and indicate the rhythm and emphasis of expressions, statements, and program structure.
Example:
‘ “ # \ ( ) {} [ ] @ , : ` . =
print(punctuators)
while true :
a={1:kartik,2:undercover}
S=( 7,8,9,self)
Computer science
Python tour
Variables
Variable represents labelled stroge location, whose values can be manipulated during program run.
Example :
student = “ Shatrughan”
Age= 12
# here “student “ is a variable name “Shatrughan” is the value of variable and “” quote is represent
the data type of variable #