Question

Write a Python program that asks for a series of names that will be provided below....

Write a Python program that asks for a series of names that will be provided below. Print out the names that are unique to the entered names.

The test data to use is: Fred, Wilma, Fred, Barney, Betty, Peebles, Dino, Fred, Wilma, Betty, Peebles, Dino, Fred.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
s = input("Please enter comma space separated names: ")
lst = []
for x in s.split(", "):
    if x not in lst:
        print(x)
        lst.append(x)

Add a comment
Know the answer?
Add Answer to:
Write a Python program that asks for a series of names that will be provided below....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • EASY PERL QUESTIONS 1. Write a subroutine, called above_average, which takes a list of numbers and...

    EASY PERL QUESTIONS 1. Write a subroutine, called above_average, which takes a list of numbers and returns the ones which are above the average (mean). (Hint: make another subroutine that calculates the average by dividing the total by the number of items.) Try your subroutine in this test program. my @fred = above_average(1..10); print "\@fred is @fred\n"; print "(Should be 6 7 8 9 10)\n"; my @barney = above_average(100, 1..10); print "\@barney is @barney\n"; print "(Should be just 100)\n"; 2....

  • Python • Write a program that asks for the names of all of the classes you...

    Python • Write a program that asks for the names of all of the classes you are taking this semester • Save these class names in a list • Print all the items in the list, one per line

  • THIS IS A PYTHON PROGRAM student.txt Ann Bob Carla Dennis Eric Frank Greg Harry faculty.txt Fred...

    THIS IS A PYTHON PROGRAM student.txt Ann Bob Carla Dennis Eric Frank Greg Harry faculty.txt Fred Wilma Betty Barney Slate Gazoo staff.txt Karen Bob Carla Joan DeeDee Michelle alumni.txt John Jane Wilma Barney Gazoo DeeDee Joan Suppose you have been provided four (4) input files that contain the names of persons who are affiliated with Clark Atlanta University in various capacities. You have been asked to write a Python program - that uses "sets" - to complete the following tasks:...

  • Write a Python program that keeps reading in names from the user, until the user enters...

    Write a Python program that keeps reading in names from the user, until the user enters 0. Once the user enters 0, you should print out all the information that was entered by the user. Use this case to test your program: Input: John Marcel Daisy Samantha Nelson Deborah 0 ================ Output: John Marcel Daisy 25 Samantha Nelson Deborah Hints: Create an array Names to hold the input names. Use the Names.append(x) function to add a new name to the...

  • Python Simple Programming Write a program in Python that calculates the tip and total for a...

    Python Simple Programming Write a program in Python that calculates the tip and total for a meal at a restaurant. When your program is run it should ... Calculate the tip and total for a meal for a restaurant Print the name of the application "Tip Calculator" Get input from the user for cost of meal and tip percent Print the tip and total amounts. The formula for calculating the tip amount is: tip = cost of meal * (tip...

  • Write a PYTHON program that asks the user for the name of the file. The program...

    Write a PYTHON program that asks the user for the name of the file. The program should write the contents of this input file to an output file. In the output file, each line should be preceded with a line number followed by a colon. The output file will have the same name as the input filename, preceded by “ln” (for linenumbers). Be sure to use Try/except to catch all exceptions. For example, when prompted, if the user specifies “sampleprogram.py”...

  • Python Write a program which asks the user keep inputting values on a line followed by...

    Python Write a program which asks the user keep inputting values on a line followed by enter until they enter a blank line, at which point the program should print the number of lines entered (excluding the blank).

  • Python 3: Write a program in python that asks the user to enter a number that...

    Python 3: Write a program in python that asks the user to enter a number that contains 4 digits, i.e. in the range [1000-9999]. Your program MUST take it as a number integer. Print each digit on a separate line.

  • Write a C++ program that asks the user to enter first lettters of the names of...

    Write a C++ program that asks the user to enter first lettters of the names of his two favourite persons. The program should print which persons name comes first alphabetically.

  • Python Programming Q.3) Write a program that repeatedly asks the user to enter words until they...

    Python Programming Q.3) Write a program that repeatedly asks the user to enter words until they enter a period ("."). Your program should then print all of the words they entered including the period) on a single line separated by spaces. For example, Enter some words (. to stop): > hello > world hello world.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT