Python Basics
Python Basics
Python Programming
Language
Object Oriented
['False', 'None', 'True', '__peg_parser__', 'and', 'as', 'assert', 'async', 'await', 'break', 'class',
Keywords 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is',
'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
Arithmetic Operator:-
+ Addition
- Subtraction
* Multiplication
/ Division(Quotient is the output, with decimal as is)
// Floor division (Rounded of number of left digit is output, without decimal)
% Modulus (Reminder is output)
** Exponent
Assignment Operator:-
Balance & Deposit example. Operands are assigned with a variable for repetitive operation
Comparison Operator:-
Logical Operator:-
Bitwise Operator:-
Used to compare binary values. Basically, numbers are converted into binary values(0&1) and then compared according to
truth tables
& Compare two binary values following AND table
| Compare two binary values following OR table
^ Compare two binary values following XOR table
~ NOT table
<< Left shift
>> Right shift
Operators:-
Membership Operator:-
Will check whether a member is present in the list or not. (e.g., Voter name in voter list of a ward)
IN returns TRUE if member is in the list
NOT IN returns TRUE if the member is not in the list
Identity Operator:-
Will check whether the object are in fact the same object or not
IS returns TRUE if object is same
IS NOT returns TRUE if object are not same
Data types:-
FOR Loop: