📖 generic · 12th TN - English Medium · COMPUTER SCIENCE · Page 53question

PYTHON – VARIABLES AND OPERATORS · Part 5

Chapter 2: 3 · COMPUTER SCIENCE

selection command. The number of whitespaces (spaces and tabs) in the indentation is not fixed, but all statements within the block must be indented with same amount spaces. . Tokens Python breaks each logical line into a sequence of elementary lexical components known as Tokens .

The normal token types are ) Identifiers, ) Keywords, ) Operators, ) Delimiters and ) Literals. Whitespace separation is necessary between tokens. . .

. Identifiers An Identifier is a name used to identify a variable, function, class, module or object. 12th Computer Chapter - - • An identifier must start with an alphabet (A..Z and a..z) or underscore ( _ ). • Identifiers may contain digits ( ..

) • Python identifiers are case sensitive i.e. uppercase and lowercase letters are distinct. • Identifiers must not be a python keyword. • Python does not allow punctuation character such as %,$, @ etc., within identifiers.

Example of valid identifiers Sum, , regno, num1 Example of invalid identifiers 12Name, name$, total-mark, continue . . . Keywords Key words are special words used by Python interpreter to recognize the structure of program.

As these words have specific meaning for interpreter, they cannot be used for any other purpose. Table . Python’s Keywords False class finally is return None continue for lambda try True def from nonlocal while and del global not with as elif if or yield assert else import pass break except in raise . .

Operators In computer programming languages operators are special symbols which represent computations, conditional matching etc. The value of an operator used is called operands . Operators are categorized as Arithmetic, Relational, Logical, Assignment etc. Value and variables when used with operator are known as operands .

(i) Arithmetic operators An arithmetic operator is a mathematical operator that takes two operands and performs a calculation on them. They are used for simple arithmetic. Most computer languages contain a set of such operators that can be used within equations to perform different types of sequential calculations. 12th Computer Chapter - - Python – Variables and Operators Python supports

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →