Answer to Question #3388 in Python for mukunda
Search = “pro”
Write a python program to find all occurrences of string ‘Search’ in a given string ‘Text
text = """
Python is a multi-paradigm programming language. Rather than forcing programmers to adopt a particular style of programming, it permits several styles: object-oriented programming and structured programming are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by meta programming and by magic methods
Many other paradigms are supported using extensions, such as pyDBC and Contracts for Python which allow Design by Contract
search = "pro"
for m in re.finditer (search, text):
print(search, "is at position", m.start())
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!