Kewprd.: Ans N TN Pthon, A Tun Thon Is A 4rmup of Related
Kewprd.: Ans N TN Pthon, A Tun Thon Is A 4rmup of Related
Eaplain with
with
Ont Suitable eample in PyHhen
M anageable
q reet ('Paul')
Qa.
h a is a Palindvome?
A Pulindyome is nouinq bat an numbe ov Shin
which reMouru unallwd when eversed .
Ample 2 32-
opuct ,
a palindvome Numbe
Ample RACE ECAR
otput- Yes, a palin/vom Sing
Palindvome Pro vam using l l e
lo op
loap
num int (input EnBew a numbev
2 tmp = num
33 Yev0
while num > 0).
dig = num , 10
eV =ev* lo + dig
num num 10
Ctemp == YevN)
print C The numbev is palindome |")
el SC
Pint Not a palincdome | ')
Ondpu
Ente a numben121
The nun bey is a palindronme
Palindme sin using inbult mehod.
sthin: "))
Shing= input
CEnte a
2 16 shiny == striny C: : 11):
Print ( The stinqis a palindrom" ")
else
print
p nt Not a pålindome")
Onkpu
Enttv Shing s1
The shmny is a palindrime
Q.3.a)
let He given twe ily be le 1, txt l e 2. tet
OuY tayk to mene both Ale into third ile Say file.3tet
Pile 2 het (onain
Suppot the text frlel.tt and
tel lowing data
file 1. txt
E file Hokpl
Ale Edit Format
Content fvomflle?
This isth
Hetlo There,
This is in filel.
l e 2.ht
-x
le-Noepad
File Edit Format vie
Hello Geeks.
This is in file 2
Below is he impt menfutjon.
#phon pogram to
t diMos r t i murginj
t 0f two files
data - ata2=
Fom file 1
tRiadin datu
Cile.txt ) as fp:
Wi open
data fpvead()
file 2
+Readin ata from
wih Optn (file 2. tt)
ao fp*
Yead O
ata l fp
#mugim files
the data of fle2
#to add
line
+ From nect
n
data t =
data += ata 2
Otpt
Filc3 Nokpad
File EdtFovmat Jitw
is +h (ontent fm file
This
Hello thure.
Thi's is in ile
Hello Gecks
2
Tis i in file
elow is tmpnetation.
#Python progvam to
# demos rat murging
t hwo ile
+rtating a lut f ftlename)
filename L'file1. tt'. file2.4xt']
+Open file 3 in uvie mo de
with Open Hle 3. tur '. 'w') as outfilc
+1tertu through list
Fov names in Hlehame)
2 Import requess
3 fmm url lib pqrje impov uYlsplit
4 from (ollectons import deque
m bs4 impovt 6eauHFul Soup
impovt panda as pd
colqb impovt Hles
7 rom g00gle.
ur 4ns(Yaped. popleft ()
19 ScYaped. a4d (url)
0
(url)
parts urlsplit
7 " 7, uvl)
pvint ("Crawlin5 URL
3
31 pon s=reuests. 9et (url)
request
33 eept Crequeshs. teptions. issing Schena
eetcpty. (onnechon Eyvov)
33 Conhnuae
34 Cra-20-9\.-t 7 t@
J3 new emails= (re.tindall
Set
43 else
ink
4
f link. Stats with (''):
link base -uvl+link
47
48
link. stars with (http'):
elif not
49
link path t |ink
R1 not link. endswith (". q2"):
S3 TF not link. endswith in unS(Yaped and
emphy diiinary
my-tple -
(t, ""Mous", C8,4,61, C1, 2, 3) )
Print (My-tuple)
Owtpu
1,2, 3
1Htello 3.4)
Mouse', L8,4, CL,2,3))