with open("hastalistem.txt", encoding="utf8") as file:
for line in file.readlines():
print(':'.join([line.strip().split(':')[i] for i in (0,-1)]))
Mükemmel çalıştı, Python çok zevkliymiş. Print sonucunu txt file a yazdırmayı da ben buluyorum. Teşekkür ederim.