diff --git a/2.py b/2.py new file mode 100644 index 0000000..908dea4 --- /dev/null +++ b/2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +"""Created on Mon Sep 25 09:00:00 2023""" +__author__ = "Trygve B. Nomeland" +__email__ = "trygve.borte.nomeland@nmbu.no" + +def park_check(park_name, park_type): + if '.' in park_name or len(park_name) > 10 or park_name == 'Denali' or park_type == 'National Park and Preserve': + return True + return False + +def main(): + NationalParks = [ + ['Denali', 'National Park and Preserve'], + ['Mt. Rainer', 'National Park'], + ['Badlands', 'National Park'], + ['Hawaii Volcanoes', 'National Park'], + ['Olympic', 'National Park'], + ['Zion', 'National Park'], + ['Everglades', 'National Park'], + ['Mt. Rushmore', 'National Monument'], + ['Bears Ears', 'National Monument'], + ['Agate Fossil Beds', 'National Monument'], + ['Sequoia', 'National Park']] + + for n, p in enumerate(NationalParks): + if park_check(p[0], p[1]): + print(f'#{n+1}', f'{p[0]}:', p[1]) + +if __name__ == '__main__': + main() \ No newline at end of file