Question: 1. Write a program named program1.py that enables the user to enter any number of celebrity names and write them to a file named celebs.txt.

1. Write a program named program1.py that enables the user to enter any number of celebrity names and write them to a file named celebs.txt. Each name should be written to one line in the file. Pressing Enter when prompted for a celebrity name should end user input and print "File was created and closed" See sample run below in which 5 names were entered, but note that more or fewer names could have been entered. SAMPLE RUN Enter celebrity name or Enter to quit Beyonce Enter celebrity name or Enter to quit Taylor Swift Enter celebrity name or Enter to quit Drake Enter celebrity name or Enter to quit Katy Perry Enter celebrity name or Enter to quit Ludacris Enter celebrity name or Enter to quit File was created and closed

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!