Uke 2
This commit is contained in:
parent
d20257bf80
commit
5b22b76dc3
30
2.py
Normal file
30
2.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user