So the file text, which I'm supposed to transfer to a dictionary for a phonebook, looks like this:
Name1 Name2 Numbers
Name3 Name4 Numbers2
and so on..
What I've tried:
def read():
file1=open("file.txt","r")
dict={}
for line in file1:
line=line.split()
if not line:continue
dict[line[0]]=line[1:]
print(dict)
When I run it, it prints nothing.
Thank you!