subject

Creating and modifying sets. The top 3 most popular male names of 2017 are Oliver, Declan, and Henry according to babynames. Write a program that modifies the male_names set by removing a name and adding a different name.
Sample output with inputs: 'Oliver' 'Atlas'
{ 'Atlas', 'Declan', 'Henry' }
NOTE: Because sets are unordered, the order in which the names in male_names appear may differ from above.
1 male_names = { 'oliver', 'Declan', 'Henry' }
2 name_to_remove = input()
3 name_to_add = input()
4 male_names = { 'oliver', 'Declan', 'Henry' }
5
6 #The statement to remove 'oliver' from the set.
7
8 male_names. remove('oliver')
9
10 #Add the name 'Atlas' in the set ,ale_names.
11
12 male_names. add('Atlas')
13
14 print(male_names)
Testing with inputs: 'Oliver''Atlas'
Your output { 'Atlas', 'Declan', 'Henry' }
Testing with inputs: 'Declan' 'Noah'
Output differs. See highlights below.
Your output { 'Atlas', 'Declan', 'Henry' }
Expected output { 'Henry', 'Noah', 'Oliver' }

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
1. which of the following is a search engine? a) mozilla firefox b)internet explorer c)google d)safari 2. which of the following statements is true? a) all search engines will provide the same results when you enter the same query. b) all search engines use the same amount of advertisements. c) some search engines are also browsers. d) search engines often provide different results, even when you enter the same query.
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
You know the right answer?
Creating and modifying sets. The top 3 most popular male names of 2017 are Oliver, Declan, and Henr...
Questions
question
Physics, 23.05.2021 21:30
question
Mathematics, 23.05.2021 21:30
question
Arts, 23.05.2021 21:30
Questions on the website: 13722363