Answer to Question #3387 in Python for mukunda
source = "Me is Rahmadja Abdulaevich.\nMe learn python."
search = "Rahmadja"
fout = open ("aboutme.txt", "w")
for s in open ("aboutme.txt"):
if re.search( search, s ):
& print( search, "is at", re.search( search, source ).start(0), "position of the line:", s )
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!