1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ozzi
3 years ago
13

Creating and modifying sets.

Computers and Technology
1 answer:
dsp733 years ago
4 0

Answer:

Explanation:

The following Python code asks the user for inputs for the name to remove and add in the set. It then tries to remove the given name from the list. If it fails it prints out to the user saying that the name does not exist. If it does exist then it removes the name and adds the new name. Finally it prints out the current list of names.

male_names = {'oliver', 'Declan', 'Henry'}

name_to_remove = input("Enter name to remove: ")

name_to_add = input("Enter name to add: ")

try:

   male_names.remove(name_to_remove)

   male_names.add(name_to_add)

except:

   print("Name that you are trying to remove does not exist")

print("List of Names: ")

print(male_names)

You might be interested in
Suppose you wanted to run a web server or ftp server from your home. what type of ip address would you want?​
Greeley [361]
You would need to have a static ip address.
3 0
3 years ago
It is ok to sell services on Xbox in exchange for real-world money
Sati [7]
Is this a true or false question? If it is let me know and I can help! (:
6 0
4 years ago
Read 2 more answers
What is the quotient of 8.16 ÷ 100​
Natalka [10]

Answer:

0.0816

Explanation:

8.16 ÷ 100 = 0.0816 (Ans)

6 0
3 years ago
Read the code snippet below and determine which markup language it is:
nignag [31]

Answer:

Sound Card

Explanation:

4 0
3 years ago
Edhesive 6.1 Code Practice
Mariulka [41]

What kind of question is this?

6 0
3 years ago
Read 2 more answers
Other questions:
  • Given that the time to read data off a 7200 rpm disk drive will be roughly 75% of a 5400 rpm disk, at what idle time of the 7200
    13·1 answer
  • I'm looking for a new laptop for school. Which laptop would be the best. Right now I have a chromebook and it is broken. 
    12·2 answers
  • Dang was accepted to a biology program with a rigorous schedule and a high tuition, but good professors. What would be a benefit
    10·2 answers
  • Which city is the largest within the Andean and midlatitude countries? A. Buenos Aires, Argentina B. La Paz, Bolivia C. Santiago
    11·2 answers
  • As u type where does excel display the entry
    10·1 answer
  • If you're searching for a date and a product at the same time, you're running a _______ query. A. Complex B. Select C. Parameter
    7·1 answer
  • Why would it be unusual to find a fossil of an organism’s eye?
    11·1 answer
  • A method signature for a method consists of all elements of the method except the body. That is, a method signature consists of
    14·1 answer
  • Question 12 (2 points)
    10·2 answers
  • Which is a concept of the CIA of Computer Security
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!