We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
operators
Ofriaknis io genarot ane undd bo
on Value> and Varah -
Povforn = operations
ite These are ALandaid 4)mbols wed 7
2 Pipose Of Loge and ayilhmoric operations
Oprahysé bose are tho spoual symbols
4+1—-,%1 7
OP2tand 3 Te is sche value on which Fha operat is
applied
Type of operannrs in Pythwn:
te Avikhmebic Operators
a. Comparison Oporators
3- Logrcal Operators
Ay Assignment opmrators
5B Biwise Opevato7s -
Avighmakic operators in Python:
Pykhon Avikhmocic opzianms ae We
> perfum foot matbonatical cperatiens
Ikko @ddlition, Subkvatkion, mutleiplication
jond diw'sion .Opeyabor Dri phon 45u nbox
-| Addibion ' adds foo ee
Operands Y
~ Subackion > Metbelplion Subiads Gl
Rwo cporands aN
* Maki plication ; i atialios
Roo cporands way
/ Division 2 divides kbe Arse xy
operand by bee Seer
y
Med elus: yous ‘he errands x
wbs0 tha firs operand 's — % Ay
divided by the sew
asa . Oukpue
be4 3
add = atb
Sb
Sab- a-b 6
mul= a¥b
]
mod= arth bsbl
P= quxb Hh
print (add)
Print Crud
Pri Ne C 5x)
Prine ¢ mod)
Prvine CP)Comparriser
Operators
rp Python, Ralotional oparabors
comyares he Valuer:
TE eithoy yohuns Tue oF Fale
according 2 rhe toad ilibn
Operaber
| ?
|
v
v
;
pla:
|
eh
Caw (a>) False
“wk cazb)
mi cama
pink (al=))
Dori Pon Syntax
Grvearey shan: (Tr) x>y
sp Hho loft . oparand
5 Qwoaster phan #0
yighe
los han: Cte)
ce yoo loft opewinal ZY
is lors Ebon He Vig
Equal Jo: CT) Meey
Te both operands are
equal |
Nok equal bo = (Tua) Aley
of operands cua MDr 4
output:}\
[rogial Qporatms
Logial opanakors oma Unxed on conditional
sealers (exho, Tre oF Faloe>
cporatos DOHIPHOn Ayntox
aie Trua- Df both % aod Y
Operands aa bu
or Tue - rf eit & nord
tho operand 15 bue
Ok Tyo TF Hho oparand = ht %
io False
Example:
azlo
b-20
if Casi and Cb>10):
Print C” Both Uondikions ana fruc)
else y
Prine (" Both Conditions ot one Ceaditon &
Aesignent opetabos: wkd
pesignmone. opps ONS
7) ansignnig yale» Pp \igriabw -opetator DEALT PLion Synean
= Assign Value OF
vig side cf ciprosion — #“9T>
JP tote sido opevond
a+ = Add and Assign: Add tho a+=b
Yighte Side operand wilh asatb
Joe sida operand and
Fxompla:
a-3 eukpue
KT S
Lea or °
ine( a),
Prinkc x)
apor procodance:
eren Heong
() faxentheses
HK Expo nan 4
=n, =! Uoay plusy oparty mind?
#1, yt uybeiedicarion, Dw'SIen.
_- Mo 4
AdduH’on, supsacior
3S Bitwise ANP
A Birwise X08
Birwise OR
eemparizon idontiby