Let the file "contacts.txt" include following sample text:
Kumar 8574075846
Priya 5873472904
Neetu 7897656378
with open("contacts.txt", "r") as file:
for line in file:
name, phone = line.strip().split()
print("Name: " + name + " \t Phone: " + phone) Name: Kumar Phone: 8574075846
Name: Priya Phone: 5873472904
Name: Neetu Phone: 7897656378