【发布时间】:2021-10-20 22:53:19
【问题描述】:
present_text="REASON FOR VISIT Referred by. Elevated PSA. HISTORY OF PRESENT ILLNESS JAMES EVERING is an 81 year old male. CURRENT MEDICATION AmLODIPine Besylate 5 MG Tablet 90 days, 0 refills PREVIOUS THERAPY: History of education and instructions"
a = ["HISTORY OF PRESENT ILLNESS","CURRENT MEDICATION","ENCOUNTER NOTES","PREVIOUS THERAPY"]
for i in a:
if i in present_text:
first_update = present_text.replace(i,i+":")
print(first_update)
Required soln: REASON FOR VISIT Referred by. Elevated PSA. HISTORY OF PRESENT ILLNESS: JAMES EVERING is an 81 year old male. CURRENT MEDICATION: AmLODIPine Besylate 5 MG Tablet 90 days, 0 refills PREVIOUS THERAPY: History of education and instructions
有没有什么办法可以用“”:“”在句子“”HISTORY OF PRESENT ILLNESS:“”和“”CURRENT MEDICATION:“”和“PREVIOUS THERAPY:”组成句子,不需要添加“” : "" 因为它已经存在于句子中
【问题讨论】:
标签: python-3.x