Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

Describe the Big Five personality dimensions.

Answered: 1 week ago