Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def build_numerology_list(compatibility_data: list[str]) -> list: Given `compatibility_data`, formatted as in NUM_COMPATIBILITY_DATA, return a list of lists with the following structure: [ [n1, [all compatible

def build_numerology_list(compatibility_data: list[str]) -> list: """ Given `compatibility_data`, formatted as in NUM_COMPATIBILITY_DATA, return a list of lists with the following structure:

[ [n1, [all compatible nums for n1], [all incompatible nums for n1]], [n2, [all compatible nums for n2], [all incompatible nums for n2]], : ]

Each inner compatibility list will be sorted in increasing order, and the overall list should be sorted by the n's.

>>> test_list = ['1,2,YES', '1,1,YES', '1,4,NO'] >>> build_numerology_list(test_list) [[1, [1, 2], [4]]]

>>> test_list = ['3,1,NO', '1,3,YES'] >>> build_numerology_list(test_list) [[1, [3], []], [3, [], [1]]]

>>> test_list = ['1,1,YES', '1,2,YES', '2,3,YES', '3,1,YES','3,2,NO'] >>> build_numerology_list(test_list)

""" # TODO: fill in the expected value for the last docstring example above

# TODO: design and write the function body

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago