Question: #!/bin/python3 importmath importos importrandom importre importsys # #Completethe'strmethod'functionbelow. # #Thefunctionacceptsfollowingparameters: #1.STRINGpara #2.STRINGspch1 #3.STRINGspch2 #4.LISTli1 #5.STRINGstrf # defstringmethod(para,special1,special2,list1,strfind): a=para b=special1 forcharinb: a=a.replace(char,) word1=a rword2=word1[69::-1] print(rword2) spaceword=rword2.replace(,)

#!/bin/python3

importmath

importos

importrandom

importre

importsys

#

#Completethe'strmethod'functionbelow.

#

#Thefunctionacceptsfollowingparameters:

#1.STRINGpara

#2.STRINGspch1

#3.STRINGspch2

#4.LISTli1

#5.STRINGstrf

#

defstringmethod(para,special1,special2,list1,strfind):

a=para

b=special1

forcharinb:

a=a.replace(char,"")

word1=a

rword2=word1[69::-1]

print(rword2)

spaceword=rword2.replace("","")

newword=special2.join(spaceword)

print(newword)

ifany(extinparaforextinlist1):

print("Everystringin%swerepresent"%list1)

else:

print("Everystringin%swerenotpresent"%list1)

'nonumber=''.join([iforiinword1ifnoti.isdigit()])'

nonumber=word1

splitted=nonumber.split()

print(splitted[0:20])

lsl=[]

di=dict()

forwinsplitted:

di[w]=di.get(w,0)+1

fork,vindi.items():

if(v

lsl.append(k)

print(lsl[-20:])

print(word1.rfind(strfind))

if__name__=='__main__':

para=input()

spch1=input()

spch2=input()

qw1_count=int(input().strip())

qw1=[]

for_inrange(qw1_count):

qw1_item=input()

qw1.append(qw1_item)

strf=input()

stringmethod(para,spch1,spch2,qw1,strf)

#!/bin/python3 importmathimportosimportrandomimportreimportsys ##Completethe'strmethod'functionbelow.##Thefunctionacceptsfollowingparameters:#1.STRINGpara#2.STRINGspch1#3.STRINGspch2#4.LISTli1#5.STRINGstrf# defstringmethod(para,special1,special2,list1,strfind):a=parab=special1forcharinb:a=a.replace(char,"")word1=arword2=word1[69::-1]print(rword2)spaceword=rword2.replace("","")newword=special2.join(spaceword)print(newword)ifany(extinparaforextinlist1):print("Everystringin%swerepresent"%list1)else:print("Everystringin%swerenotpresent"%list1)'nonumber=''.join([iforiinword1ifnoti.isdigit()])'nonumber=word1splitted=nonumber.split()print(splitted[0:20])lsl=[]di=dict()forwinsplitted:di[w]=di.get(w,0)+1fork,vindi.items():if(vlsl.append(k)print(lsl[-20:])print(word1.rfind(strfind)) if__name__=='__main__':para=input() spch1=input() spch2=input()qw1_count=int(input().strip()) qw1=[] for_inrange(qw1_count):qw1_item=input()qw1.append(qw1_item) strf=input() stringmethod(para,spch1,spch2,qw1,strf) \f\f\f\f\fimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

\f\f\f\f\f

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!