Question: This python program is working with me, but the only issue i have is that the program can't stop running ( infinite loop ) here

This python program is working with me, but the only issue i have is that the program can't stop running ( infinite loop )

here is my program

-----------------------------------------------------------------------------------------------------------------------------------------

def main():

input_file = open("mail.dat", "r")

output_file = open("addresses.dat", "w")

line = input_file.readline()

while line !=" ":

line = line.split()

for word in line:

if word.find('@')!=-1:

print(word)

output_file.write(word + " ")

line= input_file.readline()

print(line)

output_file.write(word + " ")

input_file.close()

output_file.close()

#main

main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!