Login and get coding
In this Bite you will use the modulo operation. You are presented with a function signature that receives a
listof names and you have to print them to columns.
Each column should start with a pipe character (
|) followed by a space, then the name should be wrapped in a field of
10characters wide and it should left align.
colsargument determines to how many columns the names should be split. By default this is
2, but you bet our tests check other values too 😃
Here is a little demo how the code should work:>>> names = 'Sara Tim Ana Julian'.split()
>>> from to_columns import print_names_to_columns
| Sara | Tim
| Ana | Julian
>>> print_names_to_columns(names, cols=4)
| Sara | Tim | Ana | Julian
Good luck and keep up the Python 🐍