0% found this document useful (0 votes)
1 views

Python Notes (1)

The document appears to be a fragmented and poorly formatted code or programming instructions involving various programming concepts such as input handling, conditional statements, loops, and functions in Python. It includes examples of how to perform mathematical operations, check conditions, and handle different data types. The overall structure is disorganized, making it difficult to extract coherent programming logic or specific functionalities.

Uploaded by

swarnendu mondal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Python Notes (1)

The document appears to be a fragmented and poorly formatted code or programming instructions involving various programming concepts such as input handling, conditional statements, loops, and functions in Python. It includes examples of how to perform mathematical operations, check conditions, and handle different data types. The overall structure is disorganized, making it difficult to extract coherent programming logic or specific functionalities.

Uploaded by

swarnendu mondal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Aven intisen nmben

a-intlimPut "Ente.n the numlaen )


Paint("guan is:", n**2) of two fiont numbel.
Waite. find the Podoct
Pnognam to

b= (ion(inpuf (u Enten he nunben

wap to Find alea of lo gange

n
a- Int(inputl*Enten he nem ben
b: int (inputl Enten the nun be )

Hate a tnoglam to nevense the giien SANmg.


a = (inPUt("Enten the nun ben
Paint (at::-0) difenen! Podet
Poogam to find the Sm of
Wnite a fhNo
imtisen nmben.
divison between
e
numben)]
int(inpUt ("EnteR the.
b: int( in Put("Enten the nmbea ))
Pamt
Paint (a4b)
Paint (arb)
Paint Cab)
Paint (ab)
OUTPut stalemenl
Pant fenction is sed fo dis. Play the
Python
outPut, mulkiPIe. valve by
disPay on Pait
-> Tt is fossIe. to finctin.
Sin? Sigie Paint angument ths
having two defeult
> Point function s
The Valve foa Sapeaatod is 8Paee ((' avnd end ig

Synten-j alt vat2 ,3e Pe end:

CkanPte
Paint( io,2e, 30 . seP-(#), end- " ")

a Paot
Q0

PAnt (a, end = "


Pin(b, ed>

Pnint (a,b Seps "#" end."y.


wenk then he ane P n i g
>Sefenat-en wiu ony Statement.
value
Ue in ginge pint
fow of

Ekevkiom based an

(onklo Sale, men auing to tyec


aDeitina. onditiona stalemen
LooPimg Stat emen
Conditionas Statement
dertin.
tae ereutio) based n the
flow of
4 tgPe

fetSe
ef

Simpre if Stalemenh tlo the How


Stalemet which win
dieten
->11iso based on Sne ondition.
OF erecton omdtio)
ase contle twiN Check fes the
In thiS 4NUe them win erecUte
con ditan is
14 the
the tnUe satenenf

he sptemen
Symtox Cantaal
if Cond
T38
the
chalacteaa:(in("given
"
(yes) Raint
a==,
z'U' a o, a', a
1F
',a='U, a=:i',a a=='e', a='a,
)ing: t("gve
he (aPut 6=
grvemchanacten gven tthhee then whe check WaPt
.nat ise is8
walue
mot chanace
a
>5 a
(Taue) PAin
5
and.
4>
-5 int a
an give
the (inpub("
ar-lo
0. 5
en umlce)
is gien thehhethen check toWaP
sten) (nci Pan
bongaje toaion
is Job he.
ny nny (on afen gsten Pnosam
to WAte.
a
eveny nd muliPe of 5

if a2-0 ond
pAini ("ave"

a (inpt(Enten
the chaoclen "))
if a in 'ABCDEfe H1JkLMNOPO RSTUV WAy2:
Pamt(aue ')
I/ as(inut ("Enten the canache
if AK a <: 2':
/'Aaand a: 2

twAP to check wlhe then the gi i6 ALPha bet

(inPUt(^Enten he APhabel )

Paint (aupbaet
hap o check whethen the ien nembe| is baving 9 digt
0n not.
ain!(inpot("EnteA the nwmbe))
Slalemn .
n hi5 aSe if the anditioo e 4Qve then the
4NeStoatoment blork

exeUle falke safement bioy.


Synlar > TAUp Salement block
else:
-> FalBe Stalement block

Conko

ets

aintaseSkalement
TAvestatemenf
checK the glven dafa s
Dwnite oa Proglam te
mufable on immta bie.
-> az (nputl^2nien the data y

enJ(input ( Enten the vale)


a=
if a in Ctist, 3etdict
Paint( immutable")
elge:

tthe given ehanten i8 3Peeiay


whethen
wap to check

>a= evo(im (" Enten the value )

Pnint 3feccal symbol


hhethel he Jiven
a

labe!

oNe
two vaniable ane Roinng to the

a = (ineyt( Ehen the voalee")


b (inA(^Enlen hevalue))

Paint ("seame memel oation ")


e3e:
Pnin(dfenent memy localion)
tWo valuef
wap.fo take a tUPle olec ion consist of ng an
hetafngt.
then cecu whethen the tuple is homo grn

ese:
Pain (^ heaotnos) io q
nmben is multipre of
hap to Cheek hethen tthe gven int
no. int (inpot(°ententhe vave

Point yes ")


eise:
PAintNo"
kti
Paesent ngrde

if a yefo]) = Compex;
paint (" conPrex
ei[e:

valve of tue. Cott if tit hasodd


middle
Wap to Pamt the
tength
’ azeva(input (" Entea te valle
ftenfo} =
iF (ena.2==1
Pnint (a lene)r)

weif Stalement Stallment


condidion amd Set of
mupre 3e
-’hen we have condifon hen we 3ould
evely
fon each and
etk Stalement.

hot mandatony out


i3
ese bock in elf 8lafement
-’ hnithmg with if 3 mandatarly.
ShanHng
Syrko:
7SE Paint Statement
etf Cond

elif codi

else'
T

SB
check onditHon1 if ondion o
this afe onte Nn ome amd Sfatement blocu, And
|n execUfe te tnve
then it Win
e t0Ue Hhe e fStatmen
wi Ome cuf of
go and cheek fon the
se hen it w
the condifion i fat
Tf
Becond (andition. fnoy
the comtin
ka wi check al falge sla tement
nay con
1n the Seme
deeenas biock}eise block )
Biock.(oa Defot!
o checu Whethen the given chaaet en is
Aacte a PArain on &t aseii vaue fholacte
CPPen coSe of bwen ase
asoir Pat Polo 6scii ant
Pgini bWen ase if chaacten is
(infutl th give the vaive)

Pant"CPPen ase )
elik a='A' and a= '2
Pain ( Lowen ase")
etif a cd(a)>oand and (a)<: t24 :
WOp to check
daintype

it tyee(a) int:
PAin (" int sn dalayre")
tyee(o)
Pnin (u nead datet ye)

evas) the givencaoaes


twhehen chanen if tised
OwAite a Praglam 40 Checu give)
i the
CN (ongorvnt.
tuen 3fene neide the QiSE. he Aven clhon ismt
Vawet then aven the oSti Cha Valve by vin

NGe Foint)
(Slene' on 'exlo Givenin the
Wheneen weu See
Wethe em PEy colte ton.

a: input'Entea)

if a in aeioU AEToU':

Pan)
AEToU'
etit a not in 'aeiou
Paint lond (a)
int(inputEnte the nUmben a: ")
b: ink(inpU-("Emten the. numben bi)
( >int(int Enten the. mUm
bene:)
Paint ("o is 2hetea ")

Paintc"bi8 gaaten)
Pninc is garaten)
adeale")
calacte
whethen the given
) taia WaPT Finttt check
uPencase on nof f UPPes
ConSe.
>alinAutEnten hevalve
(a) <-30:
t*{A f anL(a)=6b and ond

(owen .case.
How to Conveat uPpen cage
(onven (Owen cuse
nesvlt 9nd (tn)-32
chalacten of
the SasE
wnte a progam fo check whethe
chalacteA on not
speeial
the given Stning is
ae (ineut( " Enten he alue ")

iF not ('A'K aE]k:'z'on 'a'<:a£)<z' an


o'<- aE<=''):
Pant (SPetia chaacieny
eval(imPUt("enten the valuey
en(a)e?
Piinkahen()M2.
if yfe(aleno)/2 nt:
el3e
Pami ("Not ")

VNested if Statement
nothen if Shotemen is Calig
An if8Batemen! inSide
> the
a[ neSBed if Statemet
man then one ondion an if the
When We have each othen hen we ye
Cndition ale dIPend n
nested If.

Synto if cond2:
iE cond3:

eIse:

) ese

el#e:
FSB
|FS8
Flow di

etf con"
dite

eSe!

etSe
ege

F3B

Page.
nite ap to cneate instagamn Logn |UN= ABcfes
UN:AB123' Pu)- d234a
Pid= y2.340'
a= (input("Enten USen nome
b:(inPut(Enen oss twand)
PNd

HOme Page")
esei
Rong inPu! )
UN =:a:
if Pvd= = b!
e18e: of belagu
Pnin! ("wamg Passhond)
2is) valves Ony
of
Va|Ue af He
Paint midd le havig engh 8eotn
middie. valve is sbing and
if
tt the

a (inar^ Enten te valve')


Fafiena)/2l:
S+N ;
if typelaen(a) 72]):=
t enlaien(o)//3) >1:
pnnt ( yes)
erse ("No")
the ven Sing miy
apt Pint mi dag han of
if iS UPPan cha
(nput
= ("ente the ave") ABe'
a

if len(a), 2 =:4:
iF nK=aen(a)r2<: 'z
Paint (aen (a) r)
int (info enl en the aue)
Ab And ace:
if b<c!
elße:
SmaleSt"/
Paini ("e is 8econd
lf b<a 0nd b<c

else;Paint ("eis secnd 8moleg1")


-if C4a and c<b
esS
nini("a is cecond Smau
eige Smarest/
Second
Pnint ("b is
ese :
PAint(a,b, C ane eluol)
Second anentet
a "))
int(inPul(Enten ue volU b'))
a: (Ententhe alve
int nPut
b
nPul(Enten the alle c"J)
c= int
Aint('nPut("Enten the voa |ve"))
i
1f as b amd a c and ay d
iF b>c and b>d
Paint ("b is Second dneatest )
elif esb and c !
Pain ("ci8 3end esiy
elße:
Pain('di3 Secmdgneatest)
elit b> a and b>c and b>:
iF a>c and ad:
gneatest)
Pnint ("ais second
es ea and d>a:
Pain( i s Second gneatest')
e13e
Pains ("d is secnd gie legl
elit e a and e) b and c>d:
if asb and ad i
Poaig seRond &AealeSr
elf bya and bd'
Pint(^bis Seon d gaeat eS)
(d is Secomd gneatt )
Paint
eli d a and db and d c
if asb nd a e letest)
Paint(° a is Secnd
ejf b o and b): 40eattsE
Pnin ("bis Seo d
eißei gAentesk)
Paint("e is Setand
el3e;
Poin('a, b,c,d ane etad)
pre. of ade ahinh agor n)
(70 execte a
CxecUle Set of inSLQUetin neplo dIJ
nd-agai cmtit he fven ondtion i8 falfe.
while Loop hitifzation of the Loepng vaia ble
>m voliable is mandabel y.
nd Uttation of LooPing
volia ble tue
the LooPng
ntao wiu tayu an enson.
tHhen it i
>f we dont update the toPing vaniable

initiaisation Flo dingam


While conditin: Cono
3.8
Ufdation

Faise

URlalion
Paint Pyton do tyme8

while i<lo
Paint (yhon) i4:ltl=2
i:2< o

Python
Python
Python
Pythog
ython
Pythan
Pythan
Python
NaPto )t n ndlas noba

while i<-n
Paint fn) (i, end:)
even
to Point au the.
aive of a)) 2
>a i n t t{Enten tne

L
paint (1)
3<-50
ese:
Pnint'e havteched{i,)
formated Smg. 4<=50
422=2o
Print():4

melk'Piahon table,
waP!o nnt nth
n:intnPuLEntelt the value of N)

1to d6o.
Calculate SUm of

PAint(a)
find tut
to^Sm n nottna numbel.
(ontutnte
intnPUF (E nten the, nombe
1
white i<:n:

prni(s) nde in
at even
aP to Xact an the Valwes Paesen

t=(4)2+5), 'abe',50 , koi: o


ubie i< en(t):
whil i< (en ):
8-S+0e Casting
PAin (3)
ertaact an tae Vawel Present ima gtin.
nite a ProgAon to s2xsr
- abc dJef "abldef"
ilei<:
fact facsai
blhile k ieh(a): wyite i< lenlo):
if oelin aeioe AEToU': þ*irlfaet)
if a ih agio':
-i-/i+1/
Pjni ) Paint (3)

while

Paink 3)
4igit ofa non0
twa

n 54 4
5+441
3o
3

inpd('ata)

(o01)

fan LooP ereute


Statement wich i8 used to
> is the tooPinA nePiakead ley
iStaYement
Sane Set of ta oize LooPing va
case of fan Loop No neel vaniabie.(both viu be
-> In efdate looPing
alo no need fe
aUtenatic
3ynta
fon vaA
T58| Set, dieU Nange),
13, wPle,
Whane.coluedkion Can be Sm,

fonLooP
whielooP vg telation Ehat fime We o
Ne dont no the nmbel of
-> when Nhile looP.
of ibeAation at time
okino the nmbrn
’ when we FaNLcoP.
We Ao fon
Rongefonetie ence
o se
> 9is a foncion whichiUSed to genena
nUmben betwee the speiied nembe)

0angelen/)ae
|oniain Cyindorpsilin

| Value

have
(oitechian but # dusrot
oen 3Aurkune to dispiay the ouAPub. o ove (ome
Ne maVe
yoe mdbing.
G'venshn
wapto Pnimt cach and eVENY chaNactenResent

sAing'
fon i im a:
Pnin
GYPLKCBPLG I

Hap to nevens the givem Sling withot tye asting &3liemg


using fan op.

3az'SLAng
ev"
fon

Paint (aev

fon i in ey nnge ):
vatve the Enten nPut(
Iength.
matpig by
Liationang
it, tist inwagdB
emctey having is {E
alt 3
fnam even i8 iEamd the exlact
a towap
(S) Paint
() nt3+S=
find haPto
PAeSent dig the a ofum sthe
toen given
in ain
-
coen kap
a f to
chalarlen. sedhicd
fan
-
bse SBn(a)
i in :

Paint(" amgt Mong ")


eiße:
Paint ('No )

ed togpi he &iven
ion which i3
hito nmben of Sub Stning ana wy be Stole

Symkox
van. 8 Pit (chon

as hi heuo Howany you


b2 a.3Piif ()
Pnimk (b)

wan. 8eliE(Chan', no.of sPt:+)

You might also like