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
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