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
Lyrx [107]
3 years ago
15

The following program includes fictional sets of the top 10 male and female baby names for the current year. Write a program tha

t creates: A set all_names that contains all of the top 10 male and all of the top 10 female names. A set neutral_names that contains only names found in both male_names and female_names. A set specific_names that contains only gender specific names. Sample output for all_names: {'Michael', 'Henry', 'Jayden', 'Bailey', 'Lucas', 'Chuck', 'Aiden', 'Khloe', 'Elizabeth', 'Maria', 'Veronica', 'Meghan', 'John', 'Samuel', 'Britney', 'Charlie', 'Kim'} NOTE: Because sets are unordered, they are printed using the sorted() function here for comparison
Computers and Technology
1 answer:
bazaltina [42]3 years ago
4 0

Answer:

Following are the program in the Python Programming Language.

male_names = {'kay', 'Dev', 'Sam', 'Karan', 'Broly', 'Samuel', 'Jayd', 'Lucifer', 'Amenadiel', 'Anmol'}

female_names = {'Kally', 'Megha', 'Lucy', 'Shally', 'Bailey', 'Jayd', 'Anmol', 'Beth', 'Veronica', 'Sam'}

#initialize the union from male_names and female_names

all_names = male_names.union(female_names)

#Initialize the similar names from male_names and female_names  

neutral_names = male_names.intersection(female_names)

#initialize the symmetric_difference from male_names and female_names

specific_names = male_names.symmetric_difference(female_names)

#print the results

print(sorted(all_names))

print(sorted(neutral_names))

print(sorted(specific_names))

<u>Output</u>:

['Amenadiel', 'Anmol', 'Bailey', 'Beth', 'Broly', 'Dev', 'Jayd', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Sam', 'Samuel', 'Shally', 'Veronica', 'kay']

['Anmol', 'Jayd', 'Sam']

['Amenadiel', 'Bailey', 'Beth', 'Broly', 'Dev', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Samuel', 'Shally', 'Veronica','kay']

Explanation:

<u>The following are the description of the program</u>.

  • In the above program, firstly we set two list data type variables 'male_names' and 'female_names' and initialize the male and female names in those variables.
  • Then, we set three variables in which we store union, intersection, and symmetric differences and finally print these three variables in a sorted manner.
You might be interested in
_____ creates a border or space that separates information.
KATRIN_1 [288]
A. Padding
*************
7 0
3 years ago
Please help with my Python code - Functions
ollegr [7]

Answer:

Explanation:

see attached for help

7 0
3 years ago
Give a pseudo-code description of the O(n)-time algorithm for computing the power function p(x,n).Also draw the trace of computi
laila [671]

Answer:

p(x,n)

1. if(n==0)    [if power is 0]

2.    then result =1.

3.else

4. {    result=1.

5.      for i=1 to n.

6.          {  result = result * x. }  [each time we multiply x once]

7.       return result.

8.  }

Let's count p(3,3)

3\neq0, so come to else part.

i=1: result = result *3 = 3

i=2: result = result *3 = 9

i=2: result = result *3 = 27

Explanation:

here the for loop at step 4 takes O(n) time and other steps take constant time. So overall time complexity = O(n)

6 0
3 years ago
Stages of reverse engineering
ivann1987 [24]

Answer:

Capture Data, Refine the Model, and then Manufacture it.

Explanation:

5 0
3 years ago
What should you do when you encounter an active directory domain controller for the domain could not be contacted?
Nostrana [21]

Answer:

Issue the Dcdiag on all domain controller servers.

Explanation:

Active directory is a database that holds information of client's authentication for service access in a server. Domain controllers in servers holds these active directories, to replicate client's credentials for quick response to access to the server.

When a server domain can not contact the active directory domain controller, the Dcdiag command is issued on the server to check for connectivity issue to the DNS, AD replication, SYSVOL replication etc.

8 0
3 years ago
Other questions:
  • If you are planning to carry a large balance on your credit card, which of the following credit card features should you look fo
    7·2 answers
  • When you send an echo request message with the ping program, a successful attempt will return a(n) ______ message.
    8·1 answer
  • 1. The future of 2D animation does not include hand-drawing. (1 point)
    13·1 answer
  • PLEASE DON'T DELETE THIS QUESTION!!!!
    15·2 answers
  • Use the SQL Server Management Studio to complete the following.
    9·1 answer
  • Using Word, Maureen is writing an outline of a presentation she plans to give to her company. She will be showing a video during
    12·2 answers
  • Which type of address is used at the transport layer to identify the receiving application?
    14·1 answer
  • Please help quickly!!! which of the following is not a peripheral?
    8·2 answers
  • Write a program that echos back any inputted integer greater than 1, and exits when a 0 is entered. Your program should use a co
    11·1 answer
  • Experienced students may serve as mentors if they are at least age 21 and have at least 3 years of post-secondary education. In
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!