Program 25
Write a program that reads a file consisting of email addresses, each on its own line. Your program should print out a string consisting of those email addresses separated by semicolons.
file=open(input("Enter the File name:"))
l=file.readlines()
for line in range(len(l)):
if (l==len(l)-1):
print('{}'.format(l[line].strip()))
else:
print('{}'.format(l[line].strip()),end=";")
Enter the File name:cse.txt
satya@gmail.com;raju@gmail.com;roja@gmail.com;isa@gmail.com;koti@gmail.com;
>>>
No comments:
Post a Comment