Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Regulation Comparator | Supporting Legal Research and Compliance
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Python for Legal Professionals

bookChallenge: Regulation Comparator

When working with legal regulations, it is common to compare different versions to identify what has changed. In this challenge, you will use two hardcoded lists in Python—each representing a set of regulation section numbers or names from two versions of a regulation. Your task is to compare these lists and clearly display which sections have been added and which have been removed. To do this effectively, you will need to find the differences between the lists, then format your output so that it is easy to see which sections are new and which are no longer present. This approach helps legal professionals quickly understand regulatory changes and focus their compliance efforts.

Oppgave

Swipe to start coding

Write a function that compares two hardcoded lists of regulation sections and identifies which sections have been added or removed in the new version.

  • Identify all sections present in new_sections but not in old_sections as added sections.
  • Identify all sections present in old_sections but not in new_sections as removed sections.
  • Output the list of added sections after the label "Added sections:".
  • Output the list of removed sections after the label "Removed sections:".

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 7
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Regulation Comparator

Sveip for å vise menyen

When working with legal regulations, it is common to compare different versions to identify what has changed. In this challenge, you will use two hardcoded lists in Python—each representing a set of regulation section numbers or names from two versions of a regulation. Your task is to compare these lists and clearly display which sections have been added and which have been removed. To do this effectively, you will need to find the differences between the lists, then format your output so that it is easy to see which sections are new and which are no longer present. This approach helps legal professionals quickly understand regulatory changes and focus their compliance efforts.

Oppgave

Swipe to start coding

Write a function that compares two hardcoded lists of regulation sections and identifies which sections have been added or removed in the new version.

  • Identify all sections present in new_sections but not in old_sections as added sections.
  • Identify all sections present in old_sections but not in new_sections as removed sections.
  • Output the list of added sections after the label "Added sections:".
  • Output the list of removed sections after the label "Removed sections:".

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 7
single

single

some-alt