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 🐍
109 out of 109 users completed this Bite.
Will you be Pythonista #110 to crack this Bite?
Resolution time: ~33 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 3.67 on a 1-10 difficulty scale.
» You can do it! 😌