INF120/nasjonalparker.py
2023-09-29 12:44:20 +02:00

30 lines
1018 B
Python

# -*- 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} {p[0]}: {p[1]}')
if __name__ == '__main__':
main()