Python Forum
I am having trouble understanding homework.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I am having trouble understanding homework.
#6
hey I realized late that there is more than one way to make the string to the new inputs

Try this

male_names = { 'Oliver', 'Declan', 'Henry' }
name_to_remove = input()
name_to_add = input()

male_names.remove(name_to_remove)

male_names.add(name_to_add)

print(male_names)
Reply


Messages In This Thread
RE: I am having trouble understanding homework. - by Shaunayvette82 - Mar-02-2022, 01:37 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020