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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started