Write a function in a PYTHON to read the content of a text file “DELHI.TXT” and display all
those lines on screen, which are either starting with ‘D’ or starting with ‘M’.
1
Expert's answer
2021-08-30T01:35:28-0400
def starts_with_dm():
with open('DELHI.TXT') as file:
for line in file:
if line.startswith('D') or line.startswith('M'):
print(line)
starts_with_dm()
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment