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

Assignment1 Advancedprogramming

The document contains code snippets in Python demonstrating different programming concepts like checking if a string is a palindrome, splitting a string, counting characters in a string, filtering a list based on conditions, and updating elements in a list.

Uploaded by

Dasya Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Assignment1 Advancedprogramming

The document contains code snippets in Python demonstrating different programming concepts like checking if a string is a palindrome, splitting a string, counting characters in a string, filtering a list based on conditions, and updating elements in a list.

Uploaded by

Dasya Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Assig nmnt Nawe Avind atyal

RoUNa:LCS2022007
Ans evn ind(inp): Bdchi CS
d4
Jor ishe in nonge (Iin ('np)):
i/ indea 2:50;
even-chans t inp lindea]

phint ("Eytn place: ", evn-chars)


#fxanpe Usease
user =inpud ( "En torasting :")
evtn- ind (ugen)

Am dod chek sam ((inp):


inp):
hetusn false

inp
lant inplt)
netun finst =lat

numb sep wih


usUn-inpt inpat (" Enter a ist
Spare ")

Hesult checkusame(use hstA


print ( An Swea i neslt)
in stoing.spliH]
Is+ = [ ch Jon ch

nongt(
fon j in len (st)):

Covd t =

9etun cound
+ Usecae
inpat (" , to Stning
Ermmg ) answen)
prit (" oud
answn ( n, prefn= , stant -o):
n 20
print (er)
else :
in nonge ( stant t , 1o).
onswn(n-t, prlin t stoli),i)
# Eromple

onswn ()
(n)

Ams. del conditins ( dot)


in
7 vl >1500:

elif val >150:


Continue
else
onswen. opgtod (val )
print (onfwn)
tnate-lirds (Iit, lid ):
ia 2ip (hid4, ovem
pnid (iternl, itme
# lyomple

tnateliste ( lot, ot2)

Amt dol uplot atl, sdi) :


setl. dfoenct- up datrlsati)
# Enanple

trd2 - (3, 4, S, b, 9 }
updet (st4, snt)
aint (sot 1)

You might also like