Codecademy/learn-swift/blob/master/8-structures/Structured Exercise Regimen/Exercise.swift

what is the need for_in loop in the program ?


Welcome to the forums!

The for loop in printExercisePlan() is so that you print each of the exercises Regimen.exercises. You currently only have one exercise (pushUp) in your mondayRegimen struct, but the exercises property is an array, so it can store more than one. Try adding another exercise to mondayRegimen.exercises and then call the printExercisePlan() method again.