Strengthening week to crush the part of lack of understanding! So, it seems that one week is not enough.
I knew that I would assign a value to hash The problem is then.
Let's analyze it.
--The value is assigned to hash in the 1st to 5th lines.
-By the description of each do, the process is repeated for the number of hash elements. In this case, name, height, weight, BMI 4 times. -After the four processes are repeatedly executed, the process exits the block and ends.
Since there is no variable initialization or end judgment processing, it is more concise to use each method.
In addition, it is guaranteed that processing will not be executed beyond the range of the object. Since the range to be repeated is fixed, there is less concern about errors.
If this is output to the terminal, it is successful.
Each value is output, and the process is completed after being repeated 4 times.
I don't have enough understanding, so it takes more than an hour to get hungry after checking these contents. Understanding is deepened by outputting. Thank you.
Don't forget what you understand!
Recommended Posts