satya

Friday, October 23, 2020

Program 25

                                                                     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=";")






OUTPUT:

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

Program 30

                                                                         Program 30 Write a Python class to implement pow(x, n). class Pow1:...