I am trying to convert the display the content of the list such that only three elements print in each line, and able to write the below code using if/else, which is working