Question: PYTHON (Using loops only) no flag/def (1) Write a program that will request repeatedly that the user enters a name. The program will store the
PYTHON
(Using loops only) no flag/def
(1) Write a program that will request repeatedly that the user enters a name. The program will store the users input in a list. The user will indicate that no additional names have to be entered by hitting the Enter key directly. Print the number of names that was entered.
Note: Add an additional return at the end of all the input shown in this exercise.
If the input is:
Mary John Sarah
the output will contain
3 entries
If the input is:
Mark Emma
the output will contain
2 entries
(2) Add code to print the list of names after printing the number of names entered.
If the input is:
Mary John Sarah
the output will contain
3 entries ['Mary', 'John', 'Sarah']
If the input is:
Mark Emma
the output will contain
2 entries ['Mark', 'Emma']
(3) Output each name in the list on a separate line. You must iterate through the list using a loop to do that.
If the input is:
Mary John Sarah
the output will contain
3 entries
If the input is:
Mark Emma
the output will contain
2 entries
(2) Add code to print the list of names after printing the number of names entered.
If the input is:
Mary John Sarah
the output will end with
Mary John Sarah
If the input is:
Mark Emma
the output will end with
Mark Emma
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
