Question from the Ruby test

How to use blocks in Ruby