Pyhton Operators Cs
Pyhton Operators Cs
OPERATOR
S
Data types
variables
Python Character Set
keywords Identifiers
String operators
functions Comments
punctuators
Blocks and indentation
OPERATORS
An operator is used to perform specific mathematical or logical operation on values.
For example, in the expression 10 + num, the value 10, and the variable num are
operands and the + (plus) sign is an operator
Arithmetic Operators
Relational Operators
Logical Operators
Identity Operators
Identity operators are used to determine whether the value of a variable is of a
certain type or not.
Identity operators can also be used to determine whether two variables are referring
to the same object or not. There are two identity operators.
Membership Operators
Membership operators are used to check if a value is a member of the given sequence
or not.
Comments
Comments are used to add a remark or a note in the source code.
In Python, a comment starts with # (hash sign). Everything following the # till the
end of that line is
treated as a comment and the interpreter simply ignores it while executing the
statement.
Identifiers
In programming languages, identifiers are names used to identify a variable, function,
or other entities in a
may be followed by any combination of characters a–z, A–Z, 0–9 or underscore (_).
Thus, an identifier
third variable.
Program
Write a program that asks the user