1. Create the array (list) with 5 subject names
subjects = ["maths", "english", "computing", "art", "science"]
# 2. Define a custom function to count items in the array
def get_array_length(target_array):
count = len(target_array)
return count
# 3. Use the built-in print function to output each subject
# We use a 'for' loop to iterate through the array
for item in subjects:
print(item)
# 4. Call the custom function and print the result
total_subjects = get_array_length(subjects)
print("\nThe array contains", total_subjects, "objects.")